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

Home » Public Forums » archive » Re: Writing out TIFF files
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: Writing out TIFF files [message #5679] Thu, 25 January 1996 00:00
kak is currently offline  kak
Messages: 16
Registered: February 1995
Junior Member
Sangeet Singh <singh@thor.xraylith.wisc.edu> writes:

> I would like to write out some image arrays in IDL as .tif files. So
> far I have been able to do this *only* by doing a TVSCL of the image
> followed by a TVRD into a BYTARR which is written using TIFF_WRITE.

[stuff deleted...]

> tvscl,img2,ex,why,ORDER=1
> tifimg=tvrd(ex,why,col,row)
> TIFF_WRITE,filename5,tifimg,1

Perhaps you did not realize that there is a function BYTSCL, which should
do what you want: it scales an array to the range of byte values, so that
you can store them as 8bit TIFF file. I guess it's also used internally
by tvscl. Therefore:

tifimg=bytscl(img2)
tiff_write,'filename',tifimg

> ; The following results in a tiff file containing only random noise, not
> ; the real image.
> ;tifimg=img2
> ;OR
> ;tifimg=BYTE(img2)

The attempt with tifimg=byte(img2) must fail because you only see
the lowest bitplane of your image which usually contains the
camera noise (byte takes the rightmost 8 bits of your integer numbers).
If you apply the bitshift operation on your dataset,
you can easily travel through the bitplanes of your image:
tifimg=byte(ishft(img2,-n)) gives you the n'th bitplane of your image.

Karl
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Need Help Rendering Picture of Earth with Satellites
Next Topic: Re: Compiling IDL ... ever likey?

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

Current Time: Sat Oct 11 12:53:47 PDT 2025

Total time taken to generate the page: 0.64187 seconds