Re: problems w/PS images [message #4495] |
Thu, 15 June 1995 00:00 |
gurman
Messages: 82 Registered: August 1992
|
Member |
|
|
In article <DA81nw.AuE@hpl.hp.com>, peter@hpl.hp.com (Peter Webb) wrote:
> William Thompson (thompson@orpheus.nascom.nasa.gov) wrote:
>
> : range of 256, but the color table, which the PostScript device manages
to pick
> : up from the windowing system, still only goes up to 230. The color indices
> : higher than that end up being set to some default greyscale.
>
> : Bill Thompson
>
>
> Bill, does the color table always get picked up, or only when you
> specify the /COLOR keyword to DEVICE? It has always seemed to me
> that for grayscale postscript, you need to use top=255, while for
> screen display you need to use some smaller value to leave room for
> the window manager.
In general, you should refer to !d.n_color - 1, rather than a
hardwaired value, regardless of the device. This should also render your
code more portable among display devices.
Joe Gurman
--
J.B. Gurman / Solar Physics Branch / NASA Goddard Space Flight
Center / Greenbelt MD 20771 USA / gurman@uvsp.gsfc.nasa.gov
| Federal employees are still prohibited from holding opinions |
| while at work. Therefore, any opinions expressed herein are |
| somebody else's. |
|
|
|
Re: problems w/PS images [message #4498 is a reply to message #4495] |
Thu, 15 June 1995 00:00  |
peter
Messages: 80 Registered: February 1994
|
Member |
|
|
William Thompson (thompson@orpheus.nascom.nasa.gov) wrote:
: range of 256, but the color table, which the PostScript device manages to pick
: up from the windowing system, still only goes up to 230. The color indices
: higher than that end up being set to some default greyscale.
: Bill Thompson
Bill, does the color table always get picked up, or only when you
specify the /COLOR keyword to DEVICE? It has always seemed to me
that for grayscale postscript, you need to use top=255, while for
screen display you need to use some smaller value to leave room for
the window manager.
Peter
--
--------------------------------
Peter Webb, HP Labs Medical Dept
E-Mail: peter_webb@hpl.hp.com
Phone: (415) 813-3756
|
|
|
Re: problems w/PS images [message #4553 is a reply to message #4495] |
Fri, 09 June 1995 00:00  |
thompson
Messages: 584 Registered: August 1991
|
Senior Member |
|
|
"R. Marc Kippen" <rmkippen@unh.edu> writes:
> Hi,
> I'm having problems producing postscript images with the TV/TVSCL
> command. The following command should produce a scaled version of IMAGE
> that fits inside the region given by XSIZE, YSIZE in normal coordinates:
>> TVSCL, IMAGE, XSIZE=0.5, YSIZE=0.5, /NORMAL
> The problem is that the PS files always contain an extra vertical column
> of pixels at the far right whose color is set to 255. This happens both
> in IDL and PV~WAVE. Is this a bug in the scalable pixels of the
> postscript device??
> --Marc Kippen
I think I know what's causing your problem. It's bitten me many a time.
Window display never use all 256 colors because some of them are reserved by
the window manager or other applications. When one uses TVSCL in a window, the
image is scaled to some color index smaller than 256, let's say 230 as an
example, and the color tables are also scaled to match. When one then selects
the PostScript device and uses TVSCL again, the image is now scaled to the full
range of 256, but the color table, which the PostScript device manages to pick
up from the windowing system, still only goes up to 230. The color indices
higher than that end up being set to some default greyscale.
There are two ways around this. What I generally do is to just make sure to
reload the color table I want immediately after selecting the PostScript
device.
Another way to get around this problem is to forego using TVSCL and use the
BYTSCL routine instead with the TOP keyword. That way you can use the same
value of TOP for both the window display and the PostScript device. For
example, you can say
TOP = !D.N_COLORS - 1
TV, BYTSCL(IMAGE, TOP=TOP)
SET_PLOT,'PS'
DEVICE, /COLOR, FILENAME=...
TV, BYTSCL(IMAGE, TOP=TOP), XSIZE=0.5, YSIZE=0.5, /NORMAL
Bill Thompson
|
|
|