Home | Categories | Alphabetical | Classes | All Contents | [ < ] | [ > ]

READ_GIF


The READ_GIF procedure reads the contents of a GIF format image file and returns the image and color table vectors (if present) in the form of IDL variables. Only 8-bit images are supported, and local colormaps are not supported.

Note
The GIF format uses compression technologies that may be subject to license restrictions. If you receive a warning when attempting to use this routine, contact RSI for information about licensing options.

This routine is written in the IDL language. Its source code can be found in the file read_gif.pro in the lib subdirectory of the IDL distribution.

Note
To find information about a potential GIF file before trying to read its data, use the QUERY_GIF function.

Syntax

READ_GIF, Filename, Image [, R, G, B] [, /CLOSE] [, /MULTIPLE]

Arguments

Filename

A scalar string specifying the full path name of the image file to read.

Image

A named variable that will contain the image data read from the file.

R, G, B

Named variables that will contain the Red, Green, and Blue color vectors, if the rasterfile contains colormaps.

Keywords

CLOSE

Set this keyword to close any open files. The CLOSE keyword is only useful if a file containing multiple images (as specified by the MULTIPLE keyword) is in use. Note that you do not need to specify the normal arguments to READ_GIF (Filename, Image, etc.) when using this keyword.

MULTIPLE

Set this keyword to read files that contain multiple images. Each call to READ_GIF returns the next image, with the file remaining open between calls. The Filename argument is ignored and may be omitted after the first call. Reading past the last image returns a scalar value of -1 in the variable specified in the Image argument, and closes the file. R, G, and B color vectors are returned only once, along with the first image.

Example

To open and read the GIF image file named foo.gif in the current directory, store the image in the variable image1.

; Store the color vectors in the variables R, G, and B: 
READ_GIF, 'foo.gif', image1, R, G, B 
 
; Load the new color table and display the image: 
TVLCT, R, G, B 
TV, image1 

See Also

WRITE_GIF, QUERY_GIF


Home | Categories | Alphabetical | Classes | All Contents | [ < ] | [ > ]