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

Home » Public Forums » archive » Re: performing a TVRD() on 24 bit 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: performing a TVRD() on 24 bit images... [message #9733] Thu, 14 August 1997 00:00
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Tony Darnell writes:

> I am having some difficulty saving 24 bit TIFF files and was wondering
> if anyone out there had a solution for me. I am constructing 24 bit
> images of solar image data and am trying to save the resulting image
> to a tiff file using TVRD(TRUE=1). I am writing each image to a PIXMAP
> window and preforming the TVRD from the PIXMAP. Viewing the image in IDL
> gives me exactly what I was expecting, however, once I view the image in an
> external viewer, such as xv, the image appears to have lost some information
> because it looks lossy. I am performing the TVRD off of the PIXMAP, not the
> window showing the image, although, I tried it both ways and it doesn't seem
> to matter. Here's my code:

[ Deleted some pretty convoluted code here. Graphics_Function=7!?
I had to get the ol' manual out! :-) ]

If I had a 2D image and I wanted to make a 24-bit TIFF file
from it using the colors from color table 4, I would do this:

; Get the size of my image and make a 3D array.

image = BytScl(Dist(300,300))
s = Size(image)
image24 = BytArr(3, s[1], s[2])

; Load the color table and get the RGB vectors. I do this
; in the Z-buffer because it has 256 colors and the users
; won't see colors flashing at them.

thisDevice = !D.Name
Set_Plot, 'Z'
LoadCT, 4, /Silent
TVLCT, r, g, b, /Get
Set_Plot, thisDevice

; Make the color separations for the 24-bit image.

image24[0,*,*] = r[image]
image24[1,*,*] = g[image]
image24[2,*,*] = b[image]

; Make the TIFF file.

Write_TIFF, 'easy.tif', image24, Red=r, Green=g, Blue=b

Walla! Couldn't be simpler. This is exactly the way
I make JPEG files, too.

Cheers,

David

-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
Customizable IDL Programming Courses
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com
[Message index]
 
Read Message
Previous Topic: Re: IDL5: Bug in Widget_Slider
Next Topic: IDL Programs Available

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

Current Time: Wed Oct 08 20:03:14 PDT 2025

Total time taken to generate the page: 0.01043 seconds