24-bit color postscript again [message #13115] |
Fri, 09 October 1998 00:00  |
bowman
Messages: 121 Registered: September 1991
|
Senior Member |
|
|
I haven't been able to make my 24-bit color postscript plotting work yet,
so I wrote a simple example to illustrate my problem. You need a 24-bit
display to make this work and a color postscript printer or viewer.
PRO TEST24, PRINT = print
!P.BACKGROUND = 256L^3 - 1L ;Set background color to white
!P.FONT = -1L ;Use Hershey fonts
IF KEYWORD_SET(print) THEN BEGIN
SET_PLOT, 'PS'
DEVICE, /COLOR, BITS_PER_PIXEL = 8, /SCHOOLBOOK, FONT_SIZE=10, /PORTRAIT
!P.BACKGROUND = 0L ;Set background color to white
!P.FONT = 0L ;Use hardware fonts
ENDIF
n = 10000L
x = RANDOMU(seed, n)
y = RANDOMU(seed, n)
r = LONG(255*x)
g = LONG(255*y)
b = REPLICATE(0B, n)
color = r + 256L*(g + 256L*b)
PLOT, [0,0], [1,1], /NODATA, COLOR = 0
PLOTS, x, y, PSYM=1, COLOR = color
IF KEYWORD_SET(print) THEN DEVICE, /CLOSE
SET_PLOT, 'X'
!P.BACKGROUND = 0L
END
The program works when plotting to the X device (black in lower left, red
in lower right, green in upper left, yellow in upper right). When the
PostScript option is selected (/PRINT), all of the points plot as
grayscale or white. How do I get the colors to work with Postscript?
Thanks, Ken
--
Dr. 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 Replace AT with @
|
|
|
Re: 24-bit color postscript again [message #13177 is a reply to message #13115] |
Wed, 14 October 1998 00:00  |
bowman
Messages: 121 Registered: September 1991
|
Senior Member |
|
|
In article <701qs4$l0j$1@readme.uio.no>, steinhh@ulrik.uio.no (Stein Vidar
Hagfors Haugan) wrote:
> In article <bowman-0910980821080001@bowman.tamu.edu>
> bowman@null.edu (Kenneth P. Bowman) writes:
>
>> I haven't been able to make my 24-bit color postscript plotting work yet,
>> so I wrote a simple example to illustrate my problem. You need a 24-bit
>> display to make this work and a color postscript printer or viewer.
>
> [..snip..]
>
>> DEVICE, /COLOR, BITS_PER_PIXEL = 8, /SCHOOLBOOK, FONT_SIZE=10, /PORTRAIT
>
> Why do you expect the PS device to behave as if it's 24bit,
> when you're setting it to have 8 bits?
Well, for some bizarre reason, to display a 24-bit image in Postscript,
you set BITS_PER_PIXEL=8. Ask RSI, not me.
> I'm not sure if the decomposed color scheme works with PS
> even if you set BITS_PER_PIXEL to 24, though (i.e., you have
> to go through color tables). David F. will probably come
> along with the definitive answer soon, though :-)
I now have a definitive answer from RSI Tech Support. (I asked David
about this a few weeks ago, but, hey, even David's answers may not be
definitive! :-) )
24-bit *images* can be displayed in Postscript in IDL. Plotting commands
(PLOT, PLOTS, etc.), however, are mapped (somehow) to 8 bit. It took the
RSI Tech Support person a while to figure this out. (The documentation on
this point is obscure to nonexistent.) She was surprised to learn that
this is how PS behaves.
The Tech Support person has requested (of RSI development) that 24-bit
support be added to future versions. To the best of my knowledge, this
fundamental limitation has always been in the PS driver (while RSI has
been adding such essential features as ActiveX controls ... sorry, some of
my biases are showing...).
If you *ever* expect to need 24-bit color Postscript, please send a
request to RSI for this 'feature enhancement'. The more of us who ask for
it, the more likely we are to see it sooner rather than later.
Otherwise, someday you'll develop a great 24-bit graphics application and
then discover that you cannot print the results.
Ken Bowman
--
Dr. 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 Replace AT with @
|
|
|