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 |
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 |
READ_GIF, Filename, Image [, R, G, B] [, /CLOSE] [, /MULTIPLE]
A scalar string specifying the full path name of the image file to read.
A named variable that will contain the image data read from the file.
Named variables that will contain the Red, Green, and Blue color vectors, if the rasterfile contains colormaps.
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.
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.
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