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

Home » Public Forums » archive » New procedure to save image 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
New procedure to save image files [message #16540] Tue, 03 August 1999 00:00 Go to next message
Liam Gumley is currently offline  Liam Gumley
Messages: 473
Registered: November 1994
Senior Member
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
http://cimss.ssec.wisc.edu/~gumley/imagetools.html

Please let me know if you have any problems.

Cheers,
Liam.

--
Liam E. Gumley
Space Science and Engineering Center, UW-Madison
http://cimss.ssec.wisc.edu/~gumley
Re: New procedure to save image files [message #16627 is a reply to message #16540] Wed, 04 August 1999 00:00 Go to previous message
Liam Gumley is currently offline  Liam Gumley
Messages: 473
Registered: November 1994
Senior Member
"Eric E. Dors" wrote:
> I think that your saveimage routine is great!!! One comment:
> I think that image dithering would be better as an command line
> parameter instead of being hard-coded into your call to color_quan.

Done. See the updated version at
http://cimss.ssec.wisc.edu/~gumley/imagetools.html

I also added a check for IDL 5.1 or higher, which is required to allow
the statement

DEVICE, GET_VISUAL_DEPTH=DEPTH

which determines whether the current IDL session is in 8-bit or 24-bit
mode.

> thanks a lot for posting this routine,

No worries.

--
Liam E. Gumley
Space Science and Engineering Center, UW-Madison
http://cimss.ssec.wisc.edu/~gumley
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: area enclosed by a polygon on a sphere
Next Topic: Re: plot irregularly gridded map data

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

Current Time: Sat Oct 11 10:35:54 PDT 2025

Total time taken to generate the page: 2.40022 seconds