[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Baffled by color postscript



In article <36E582B4.E3E8863D@ssec.wisc.edu>, Liam Gumley
<Liam.Gumley@ssec.wisc.edu> wrote:

> David Fanning wrote:
> > Liam Gumley (Liam.Gumley@ssec.wisc.edu) writes:
> > > I guess I'm not sure I understand the problem. I'm able to display true
> > > color images with colored graphics overlays; I've attached a Postscript
> > > example to this message. The postscript file includes 6 test images.
> > > Images 2, 4, and 6 are true color (24 bit) with colored lines (axes,
> > > title, colorbar) overlaid. I've also attached a JPEG version that was
> > > created from the postscript (using ImageMagick).

I think you can use *colors* in the "PLOT" part of the program, but not
256^3 *different* colors (i.e., 24-bit).

Here's an example of a program that works great on a 24-bit X display, but
does not produce the appropriate color PS output.  (No bitmaps involved.)

PRO TEST24, PRINT = print

IF KEYWORD_SET(print) THEN BEGIN
   SET_PLOT, 'PS'
   DEVICE, /COLOR, BITS_PER_PIXEL = 8, /SCHOOLBOOK, FONT_SIZE=10, /PORTRAIT
   !P.FONT =  0L                               ;Use hardware fonts
ENDIF
PRINT, !P.BACKGROUND

n = 1000L
x = RANDOMU(seed, n)
y = RANDOMU(seed, n)
r = LONG(255*x)
g = LONG(255*y)
b = REPLICATE(0B, n)

PLOT, [0,0], [1,1], /NODATA
PLOTS, x, y, PSYM=1, COLOR = r + 256L*(g + 256L*b)

HELP, /DEVICE
HELP, !P, /STRUCT
HELP, !D, /STRUCT
TVLCT, r, g, b, /GET
PRINT, r, g, b

IF KEYWORD_SET(print) THEN DEVICE, /CLOSE 
SET_PLOT, 'X'
!P.FONT = -1L                                  ;Use Hershey fonts

END

-- 
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 @