Kenneth P. Bowman (bowman@null.tamu) writes:
> I have an IDL application that creates 24-bit X displays consisting of a
> grayscale image with points plotted on top in color using PLOTS. (Yes, it
> really is preferable to do this using 24-bit color.) Color works fine on
> the screen, but everything comes out grayscale in Postscript. This is
> direct graphics, BTW.
>
> I have read the Reference manual section on color Postscript, but it is
> less than clear. It only addresses color images, not 24-bit color created
> with things like PLOTS.
>
> My copy of David Fanning's book is at work, so I have not been able to
> check it (will do so in the morning).
>
> Any suggestions?
Buy another book for home.
Oh!? You mean about color PostScript? :-)
Well, you might think, since this is a 24-bit PostScript
printer you've got here, that you can draw a line in a color
like you would on your display device (I.e., specify the
color as a 24-bit integer value). For example, if I am
working on a 24-bit display with color decomposition turned
on and I want to draw a line in a yellow color, I would
type this:
PlotS, [0,1], [0,1], /Normal, Color=65635
Or, more likely, since I don't normally think in binary
arithmetic, I might type:
PlotS, [0,1], [0,1], /Normal, Color='00ffff'x
But, unfortunately, this does NOT work in PostScript.
Even though you can display 24-bit color images in PostScript,
you can't for some reason write 24-bit colors like this.
In fact, you MUST use the INDEXED color model to draw a
line in a color. But this is not much of a problem in a
24-bit world, since you aren't really using the color
table for anything else. (Your 24-bit image colors
were expressed *directly* through the actual
pixel values of the image and didn't go *through* the
color table.)
So, I can display a grayscale image and put a yellow
line on top of this image like this:
TV, image ; or TV, image24, True=1, etc.
TVLCT, 255, 255, 0, 10
PlotS, [0,1], [0,1], /Normal, Color=10
Device, /Close_File
This is not the most lucid explanation I've even written (I've
had a few beers to celebrate the worker's cause), so let
me know if you have any questions. :-)
Cheers,
David
----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438, Toll-Free Book Orders: 1-888-461-0155
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|