Article View: comp.lang.postscript
Article #9146Re: Help: ColorPS File -> B&W Printer
From: robert tatar
Date: Fri, 02 Mar 1990 22:22
Date: Fri, 02 Mar 1990 22:22
49 lines
2488 bytes
2488 bytes
Dan Cerys:
In a previous message you wrote:
>>I have a color Postscript file that I'd like to print on a B&W Postscript
>>printer. Is there a simple utility that will convert the colors to the
>>appropriate grey scales? The file's on a UNIX machine, but other
>>environments are available.
You didn't say if your "color Postscript" file used the "new" color extensions
(for color images) or not, but I assume it does. I'm sure that you are aware
that the original postscript supports some color operations, such as for line
drawing, etc. and does color to gray scale conversion for those operations.
The good news is:
1) I have written a "colorimage" (postscript!) operator for B&W printers.
2) It uses the CIE color formula for conversion of RGB color to gray scale.
3) It works.
I used this for testing a sun_raster_to_postscript program that I wrote.
The bad news is:
1) It ONLY emulates one mode of the color image operator.
(single procedure & RGB or "false 3" mode)
2) It assumes 8 bits/pixel.
3) It (necessarily) consumes virtual memory, which further limits the
raster size of the image.
4) It is slow (as expected!).
If your files live within these constraints, I can send you the code.
It could be modified for other bits/pixel or other modes.
The trickiest part is to take an arbitrary procedure that reads data for the
"colorimage" operator and replace it with a new procedure (proc) that passes
data to the "image" operator. I don't know how robust my solution is, but it
works with a proc for the colorimage operator that uses run-length encoding
and a color map. The output of this proc is a variable length string of
repeating RGBRGBRGB... bytes.
I thought a little bit about making it more general and I disagree slightly
with Amanda Walker. It is certainly possible, but I don't think it will be
easy to write.
If you know anyone interested in hacking this for the other modes, let me
know.
R. Tatar
tatar@crd.ge.com
Technical Details
Message-ID:
<5737@crdgw1.crd.ge.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uwm.edu!rpi!crdgw1!boreas!tatarReferences:
<52705@bbn.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uwm.edu!rpi!crdgw1!boreas!tatar From: tatar@boreas.crd.ge.com (robert tatar) Newsgroups: comp.lang.postscript Subject: Re: Help: ColorPS File -> B&W Printer Message-ID: <5737@crdgw1.crd.ge.com> Date: 2 Mar 90 22:22:45 GMT References: <52705@bbn.COM> Sender: news@crdgw1.crd.ge.com Reply-To: boreas!tatar@steinmetz.UUCP (robert tatar) Organization: General Electric Corporate R&D Center Lines: 49