comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: problems w/PS images
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: problems w/PS images [message #4553 is a reply to message #4495] Fri, 09 June 1995 00:00 Go to previous message
thompson is currently offline  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
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: TLB_GET_SIZE - strangeness!
Next Topic: Re: Generating MPEG with WAVE

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Dec 03 08:19:18 PST 2025

Total time taken to generate the page: 1.12795 seconds