Screen Capture Tools for IDL
SAVEIMAGE (
Version 1.17, 8 February 2000. IDL 5.0 or
higher required)
Save the contents of the current graphics window to a GIF, BMP,
PICT, TIFF, or JPEG format output file, e.g.
IDL> saveimage, 'test.gif'
IDL> saveimage, 'test.jpg', /jpeg
SHOWIMAGE (Version 1.15, 19
November 1999. IDL 5.2 or higher required)
Display an image in GIF, BMP, PICT, TIFF, or JPEG format (the
format is detected automatically), e.g.
IDL> showimage, 'test.gif'
Both procedures work transparently in either 8-bit (256 color), 16-bit (65,536 color), or 24-bit (16,777,216 color) display mode.
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 the procedure SAVEIMAGE which determines whether you are running IDL in 8, 16, or 24-bit mode, and automatically does any conversions necessary to save the image in the selected format. In addition, I wrote a companion procedure SHOWIMAGE, which reads and displays images in any of the formats supported by SAVEIMAGE, regardless of whether you are running in 8, 16, or 24-bit mode.
Please let me know if you have any questions or comments, especially if you find a bug. SAVEIMAGE and SHOWIMAGE are licensed under the terms of the GNU General Public License (GPL).
8 February 2000
21 January 2000
19 November 1999
10 September 1999
Both procedures now handle image order correctly (thanks to Ivan Zimine for the tip).
9 September 1999
Liam E. Gumley
Last updated 8 February 2000