Re: Creating TIFF files from an image [message #2798] |
Tue, 13 September 1994 06:08 |
gumley
Messages: 10 Registered: May 1993
|
Junior Member |
|
|
In article <Cw26qt.D9w@aston.ac.uk>, jollygw@aston.ac.uk (G W Jolly) wrote:
> I know it is probably in one or more of the manuals, but I spent several
> hours yesterday trying to save an image to a TIFF file using PV-WAVE
> Command Language. I was able to produce a window on screen with image I
> wanted using TVSCL on double precision data, but I couldn't use TVRD to
> read that image from the screen (I am using an IPX SUN Sparc-station
> running Solaris, Openwindows 3.3).
My experience is with IDL, but presumably it is applicable to PV-WAVE.
I assume you are working with a grey scale (or 8 bit lookup table) image
(TIFF only stores 8 bit images).
First load your image data (integer, long, float or whatever), then
plot, histogram( image, min = 0 ) ; (manually choose good minvalue and
maxvalue)
simage = bytscl( image, min = minvalue, max = maxvalue ) ; create byte
scaled image
tv, simage ; check that it looks ok
tiff_write, 'image.tiff', simage ; save it to a TIFF file
The only reason you would need to use TVRD is if you have drawn graphics or
text over the top of the image. In all other cases, just use the image
array itself. TVSCL automatically selects the maximum and minimum values
in the image, which is not necessarily what you want - look at the
histogram. This method works equally well for 24 bit RGB images.
--
Liam E. Gumley
NASA/GSFC Climate and Radiation Branch
Greenbelt MD, USA
|
|
|