[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

New procedure to save image files

I finally decided I was tired of the usual process involved in saving
the contents of the current graphics window to an image file (GIF or
JPEG for example). These days IDL users are just as likely to have a
24-bit display as an 8-bit display, and thus you run into cases where a
24-bit image is displayed on-screen, but you want to save it as an 8-bit
image (e.g. GIF). Likewise, there are times when an 8-bit image is
displayed on-screen, but you want to save it as 24-bit (e.g. JPEG). 

To get around all the headaches involved in this process, I wrote a
procedure named SAVEIMAGE which determines whether you are running IDL
in 8-bit or 24-bit mode, and automatically does any conversions
necessary to save 8-bit or 24-bit output. The following output formats
are supported: 

8-bit: GIF (default), BMP 
24-bit: JPEG, TIFF 

Using the procedure is as simple as 

IDL> saveimage, 'test.gif' 

You can find the source at

Please let me know if you have any problems.


Liam E. Gumley
Space Science and Engineering Center, UW-Madison