The features described in this topic are obsolete
and should not be used in new IDL code.
TIFF_READ
This routine is obsolete and should not be used in new IDL code.
The TIFF_READ function has been renamed but retains the same functionality it had in previous releases. See READ_TIFF in the IDL Reference Guide.
The TIFF_READ function reads 8-bit or 24-bit images in TIFF format files (classes G, P, and R) and returns the image and color table vectors in the form of IDL variables. Only one image per file is read. TIFF_READ returns a byte array containing the image data. The dimensions of the result are the same as defined in the TIFF file (Columns, Rows).
For TIFF images that are RGB interleaved by pixel, the output dimensions are (3, Columns, Rows).
For TIFF images that are RGB interleaved by image, TIFF_READ returns the integer value zero, sets the variable defined by the PLANARCONFIG keyword to 2, and returns three separate images in the variables defined by the R, G, and B arguments.
Syntax
Result = TIFF_READ(File [, R, G, B])
Arguments
File
A scalar string containing the name of file to read.
R, G, B
Named variables that will contain the Red, Green, and Blue color vectors extracted from TIFF Class P, Palette Color images. For TIFF images that are RGB interleaved by image (when the variable specified by the PLANARCONFIG keyword is returned as 2) the R, G, and B variables each hold an image with the dimensions (Columns, Rows).
Keywords
ORDER
Set this keyword to a named variable that will contain the order parameter from the TIFF File. This parameter is returned as 0 for images written bottom to top, and 1 for images written top to bottom. If the Orientation parameter does not appear in the TIFF file, an order of 1 is returned.
PLANARCONFIG
Set this keyword to a named variable that will contain the interleave parameter from the TIFF file. This parameter is returned as 1 for TIFF files that are GrayScale, Palette, or RGB color interleaved by pixel, or as 2 for RGB color TIFF files interleaved by image.
Example
Read the file my.tif in the current directory into the variable image, and save the color tables in the variables, R, G, and B by entering:
To view the image, load the new color table and display the image by entering: