The features described in this topic are obsolete
and should not be used in new IDL code.

TIFF_WRITE

This routine is obsolete and should not be used in new IDL code.

The TIFF_WRITE procedure has been renamed but retains the same functionality it had in previous releases. See WRITE_TIFF in the IDL Reference Guide.

The TIFF_WRITE procedure writes 8- or 24-bit images to a TIFF file. Files are written in one strip, or three strips when the PLANARCONFIG keyword is set to 2.

Syntax

TIFF_WRITE, File, Array [, Orientation]

Arguments

File

A scalar string containing the name of file to create.

Array

The image data to be written. If not already a byte array, it is made a byte array. Array may be either an (n, m) array for Grayscale or Palette classes, or a (3, n, m) array for RGB full color, interleaved by image. If the PLANARCONFIG keyword is set to 2 then the Array parameter is ignored (and may be omitted).

Orientation

This parameter should be 0 if the image is stored from bottom-to-top (the default). For images stored from top-to-bottom, this parameter should be 1.

Warning: not all TIFF readers are capable of reversing the scan line order. If in doubt, first convert the image to top-to-bottom order (use the REVERSE function), and set Orientation to 1.

Keywords

RED, GREEN, BLUE

If you are writing a Class P, Palette color image, set these keywords equal to the color table vectors, scaled from 0 to 255.

If you are writing an image that is RGB interleaved by image (i.e., if the PLANARCONFIG keyword is set to 2), set these keywords to the names of the variables containing the 3 color component image.

PLANARCONFIG

Set this keyword to 2 if writing an RGB image that is contained in three separate images (color planes). The three images must be stored in variables specified by the RED, GREEN, and BLUE keywords. Otherwise, omit this parameter (or set it to 1).

XRESOL

The horizontal resolution, in pixels per inch. The default is 100.

YRESOL

The vertical resolution, in pixels per inch. The default is 100.

Examples

Four types of TIFF files can be written:

TIFF Class G, Grayscale.

The variable array contains the 8-bit image array. A value of 0 is black, 255 is white. The Red, Green, and Blue keywords are omitted.

TIFF_WRITE, 'a.tif', array 

TIFF Class P, Palette Color

The variable array contains the 8-bit image array. The keyword parameters RED, GREEN, and BLUE contain the color tables, which can have up to 256 elements, scaled from 0 to 255.

TIFF_WRITE, 'a.tif', array, RED = r, GREEN = g, BLUE = b 

TIFF Class R, RGB Full Color, color interleaved by pixel

The variable array contains the byte data, and is dimensioned (3, cols, rows).

TIFF_WRITE, 'a.tif', array 

TIFF Class R, RGB Full Color, color interleaved by image

Input is three separate images, provided in the keyword parameters RED, GREEN, and BLUE. The input argument Array is ignored. The keyword PLANARCONFIG must be set to 2 in this case.

TIFF_WRITE, 'a.tif', RED = r, GREEN = g, BLUE = b, PLAN = 2