[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Baffled by color postscript
In article <MPG.114df9eb8bc3875398970e@news.frii.com>, davidf@dfanning.com
(David Fanning) wrote:
> Here is where I am the shakiest. I'm going to assert that
> even if you COULD produce 24-bit PostScript output (and
> I don't think you can from within IDL), there probably
> isn't a printer around that could print it. I say this
> based on my own understanding of printing technology and
> a real quick look around the web for 24-bit color printers.
> The best I found was a printer that claims to print in
> 4-color CMYK color. Anyway, if someone knows better I'd love
> to hear from you.
>
> But that said, I am quite certain that you cannot get 24-bit
> PostScript color out of IDL. (This may not even be an IDL
> problem. I think it likely that the PostScript Level 2
> specification doesn't allow it, although I don't know this
> to be true.)
Hi David,
PostScript definitely supports 24-bit color, and has for years, but the
IDL driver does not - except for bitmap objects in the PS file.
To do a 24-bit bitmap in PS (this is in the documentation) you do
SET_PLOT, 'PS'
DEVICE, /COLOR, BITS_PER_PIXEL=8 ;Don't forget /COLOR!
image = BYTARR(8L, 8L, 3L) ;Make a tiny image
image[*,*,0L] = 8B ;Set red plane to 8 (08 in hex)
image[*,*,1L] = 10B ;Set green plane to 10 (0A in hex)
image[*,*,2L] = 15B ;Set blue plane to 150 (0F in hex)
TV, image, TRUE = 3L ;Display image interleaved over dim 3
DEVICE, /CLOSE
In the PS file you find:
gsave /rstr 8 string def /gstr 8 string def /bstr 8 string def
12700 12700 scale 8 8 8 [8 0 0 8 0 0]
{ currentfile rstr readhexstring pop} bind
{ currentfile gstr readhexstring pop} bind
{ currentfile bstr readhexstring pop} bind
true 3 colorimage
08080808080808080a0a0a0a0a0a0a0a0f0f0f0f0f0f0f0f08080808080808080a0a0a0a0a0a0a0a0f0f0f0f0f0f0f0f08080808080808080a0a0a0a
0a0a0a0a0f0f0f0f0f0f0f0f08080808080808080a0a0a0a0a0a0a0a0f0f0f0f0f0f0f0f08080808080808080a0a0a0a0a0a0a0a0f0f0f0f0f0f0f0f
08080808080808080a0a0a0a0a0a0a0a0f0f0f0f0f0f0f0f08080808080808080a0a0a0a0a0a0a0a0f0f0f0f0f0f0f0f08080808080808080a0a0a0a
0a0a0a0a0f0f0f0f0f0f0f0f
which is an 8x8 24-bit image.
So one ugly alternative for making 24-bit color plots is to plot to a
24-bit X or Z device, TVRD read the image, switch to PS, TV the image, and
then send the PS file to a color printer.
Regards, Ken
--
Kenneth P. Bowman, Professor 409-862-4060
Department of Meteorology 409-862-4466 fax
Texas A&M University bowmanATcsrp.tamu.edu
College Station, TX 77843-3150 Change the AT to @