Overview of Image Objects
An object of the IDLgrImage class (see "IDLgrImage" (IDL Reference Guide)) represents a two-dimensional array of pixel values, rendered on the plane z = 0. The image object stores image data using the byte data type, and can take any of the following forms:
- An array with dimensions [n, m]. Each pixel is interpreted as an index into a palette, or as an explicit gray scale value (if the GREYSCALE keyword is set).
- An array with dimensions [2, n, m] or [n, 2, m] or [n, m, 2]. Each pixel consists of a gray scale value and an associated alpha channel value (alpha is used for transparency effects).
- An array with dimensions [3, n, m] or [n, 3, m] or [n, m, 3]. Each pixel consists of an RGB triple.
- An array with dimensions [4, n, m] or [n, 4, m] or [n, m, 4]. Each pixel consists of an RGB triple and an associated alpha channel value.
The index or RGB triple for each pixel is interpreted according to the color model set for the destination object in which it is to be drawn. The Alpha channel, if present, determines the transparency of the pixel.
Note
The position of the color bands in an RGB image array is know as interleaving. See RGB Image Interleaving (Using IDL) for details. The INTERLEAVE property of the image object describes this arrangement.
Defining Image Palettes
If your image array contains indexed color data (that is, if it is an m-by-n array), you can specify a palette object to control the conversion between the image data and the palette used by an RGB-mode destination object. (See How IDL Interprets Color Values for a discussion of the interaction between indexed color objects and RGB color destinations.) Set the PALETTE property of the image object equal to an instance of an IDLgrPalette object:
To specify that an image be drawn in greyscale mode rather than through an existing color palette, set the GREYSCALE property equal to 1 (one). The GREYSCALE property is only used if the image data is a single channel (an m-by-n array).
Note
A 2-by-m-by-n array is considered to be a greyscale image with an Alpha channel. An image containing indexed color data cannot have an alpha channel.
For examples, see Displaying Indexed Images with Object Graphics in the Examples section of "IDLgrPalette" (IDL Reference Guide).
Configuring Common Object Properties
IDLgrImage properties allow you to configure how image objects are displayed. You can alter the transparency (using the ALPHA_CHANNEL keyword), or the color (using the PALETTE keyword for indexed images, or the INTERLEAVE keyword for RGB images). You may want to fit one image to another using warping or create a texture map by mapping an image onto a geometric shape. See the following sections for more information.
- Creating Image Objects provides examples and resources for creating image objects containing a variety of data
If you want to display very large images, you can do so with image tiling. See Image Tiling for information.