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

Home » Public Forums » archive » Re: using TVRD on idl 5.1
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: using TVRD on idl 5.1 [message #20395] Tue, 20 June 2000 00:00
Ben Tupper is currently offline  Ben Tupper
Messages: 186
Registered: August 1999
Senior Member
Peliz wrote:

> I need a color output to a .ppm file on my system (solaris 2.5 & IDL
> 5.1). The way I am trying (and I think it works on a PC)
> is to use the output of tvrd(/true). But it is not working...
> If I use,
> x = tvrd(/true)
> tv, x, /true
> shouldn't I get the same window?
> Even if my x look a little strange (half good half kind of
> noisy) how comes the result in the .ppm is a repeated pattern (~3x)?!
> the remarks under"
> Unexpected Results Using TVRD with X Windows" of the idl help
> did not solve the problem!
>
> As anyone trayed this? (not on a PC not to a GIF)
> thanks a lot,
>
>

Hello,

It is unfortunate that you want to use a the PPM format, otherwise you
could use Liam's SAVEIMAGE routine (see posting below regarding sving
GIF format images.) You will get strange results (as you described)
when you specify /TRUE for TVRD when you have an 8bit display.

Try the following....

;get the image
X = TVRD()
;get the color vectors
TVLCT, Red,Green,Blue, /Get
;make a 24 bit array
Sz = Size(X,/Dim)
Img = BytArr(3,SZ[0],Sz[1])
;assign each of the red, green, blue values of each pixel
Img[0,*,*] = Red[X[*,*]]
Img[1,*,*] = Green[X[*,*]]
Img[2,*,*] = Blue[X[*,*]]
;write the image
Write_PPM, FileName, Img



Ben

--
Ben Tupper

Bigelow Laboratory for Ocean Science
tupper@seadas.bigelow.org

pemaquidriver@tidewater.net
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Image in postscript
Next Topic: axis in scientific notation

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

Current Time: Wed Oct 08 13:54:35 PDT 2025

Total time taken to generate the page: 0.00545 seconds