Display Device Color Schemes
Most modern computer monitors use one of two basic schemes for displaying color at each pixel:
- Indexed - A color is specified using an index into a hardware color lookup table (or palette). Each entry of the color lookup table corresponds to an individual color, and consists of a red value, a green value, and a blue value. The size of the lookup table depends upon the hardware.
- RGB - A color is specified using an RGB triple: [red, green, blue]. The number of bits used to represent each of the red, green, and blue components depends upon the hardware.
The description of how color is to be interpreted on a given display device is referred to as a visual. Each visual typically has a name that indicates how color is to be represented. Two very common visual names are PseudoColor (which uses an indexed color scheme) and TrueColor (which uses an RGB color scheme).
A visual also has a depth associated with it that describes how many bits are used to represent a given color. Common bit depths include 8-bit (for PseudoColor visuals) and 16- or 24-bit (for TrueColor visuals). An n-bit visual is capable of displaying 2n total colors. Thus, an 8-bit PseudoColor visual can display 28 or 256 colors. A 24-bit TrueColor visual can display 224 or 16,777,216 colors.
PseudoColor visuals rely heavily upon the display device's hardware color table for image display. If the color table is modified, all images being displayed using that color table will automatically update to reflect the change.
TrueColor visuals do not typically use a color table. The red, green, and blue components are provided directly.
Note
You can display TrueColor images on pseudo-color displays by using the COLOR_QUAN function. This function creates a pseudo-color palette for displaying the TrueColor image and then maps the TrueColor image to the new palette. See COLOR_QUAN for more information.
Setting a Visual on UNIX Platforms
On UNIX platforms, an application (such as IDL) may choose from among the set of X visuals that are supported for the current display. Each visual is either grayscale or color. Its corresponding color table may be either fixed (read-only), or it may be changeable from within IDL (read-write). The color interpretation scheme is either indexed or RGB. The following table shows the supported visuals for a given display, which may include any combination:
The most common of these is PseudoColor and TrueColor. Refer to the section Colors and IDL Graphic Systems to learn more about how IDL selects a visual for image display.
To get the list of supported X visual classes on a given system, type the following command at the UNIX command line:
Setting a Visual on Windows Platforms
On Windows platforms, the visual is selected via the system Control Panel. To open the Control Panel, select the Settings → Control Panel item from the Start menu. Click on the Display and then select the Settings tab. Alter the Color quality setting to modify the visual before starting an IDL session. The following table shows three visuals are supported (for the particular display configuration used in this example):
|
Visual
|
Equivalence to UNIX Visuals
|
|---|---|
| 256 Colors |
8-bit PseudoColor |
| High Color (16 bit) |
16-bit TrueColor |
| True Color (32 bit) |
32-bit TrueColor |