Displaying TrueColor Images
TrueColor images map data values in a three-dimensional array to Red, Green, and Blue color values, which are combined into a color image for display. The three-dimensional array is made up of three two-dimensional image planes combined into a single array: either (3 x width x height), (width x 3 x height), or (width x height x 3). The organization of the image planes within the file (known as interleaving) is important when displaying images using the TV command, but less so when using the iImage interface.
Displaying TrueColor Images with TV
The TV routine creates a static display of the image data in the specified array. For example, to read the data from the file rose.jpg in IDL's examples/data subdirectory into an IDL variable named rose:
file = FILEPATH('rose.jpg', SUBDIRECTORY=['examples', 'data'])
READ_JPEG, file, rose
You might assume that simply supplying the rose variable to the TV command would result in a color image:
but this does not produce the correct image. The fault here lies with the fact that the TV routine expects, by default, that is argument is a two-dimensional array, when in fact the dimensions of the rose array are [3 x 227 x 149], as shown by the HELP command:
This arrangement of image planes is known as pixel interleaving. To accurately display the a pixel-interleaved array using TV, set the TRUE keyword equal to 1:
WINDOW, XSIZE=227, YSIZE=149
TV, rose, TRUE=1

The value of the TRUE keyword corresponds to the arrangement of the image planes in the three-dimensional array. Specifically, a width column by height row TrueColor image will use one of the following arrangements:
|
TRUE Value
|
Dimensions
|
Interleaving
|
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Clearly, you must know the type of interleaving used by your image data before you can display it properly using the TV command.
Displaying TrueColor Images with iImage
The IIMAGE routine removes the requirement that you know in advance how your color image is arranged. To display the rose variable in iImage, simply enter:

You can immediately notice several things about the iImage display:
- The View Zoom manipulator (the magnifying glass-shaped icon on the toolbar and its associated dropdown menu) allow you to interactively zoom in and out. In the image above, the display has been enlarged to 200% of its normal size, as indicated by the value in the dropdown menu.
- The window level controls at the lower right of the iImage interface allow you to interactively adjust and manipulate the image brightness and contrast of each of the three color channels independently.
- The Edit Palette button is disabled, since the array being displayed contains three image planes, and thus contains its own color information. No palette is used.
In addition, a variety of filtering operations can be applied to the image data by selecting from the Operations menu.
Further Information
For additional information on displaying indexed color images, see:
- IIMAGE in the IDL Reference Guide
- TV in the IDL Reference Guide
- Working with Images in the iTool User's Guide