IDL uses color tables to associate pixel values in indexed images with specific RGB color values. IDL's predefined color tables are listed in the table below. To open a dialog with the list of predefined colors, type XLOADCT at the IDL command prompt.

You can also define custom color tables with the COLORTABLE function.

Index Value

Name

Sample

0

B-W LINEAR

1

BLUE/WHITE

2

GRN-RED-BLU-WHT

3

RED TEMPERATURE

4

BLUE/GREEN/RED/YELLOW

5

STD GAMMA-II

6

PRISM

7

RED-PURPLE

8

GREEN/WHITE LINEAR

9

GRN/WHT EXPONENTIAL

10

GREEN-PINK

11

BLUE-RED

12

16 LEVEL

13

RAINBOW

14

STEPS

15

STERN SPECIAL

16

Haze

17

Blue - Pastel - Red

18

Pastels

19

Hue Sat Lightness 1

20

Hue Sat Lightness 2

21

Hue Sat Value 1

22

Hue Sat Value 2

23

Purple-Red + Stripes

24

Beach

25

Mac Style

26

Eos A

27

Eos B

28

Hardcandy

29

Nature

30

Ocean

31

Peppermint

32

Plasma

33

Blue-Red

34

Rainbow

35

Blue Waves

36

Volcano

37

Waves

38

Rainbow18

39

Rainbow + white

40

Rainbow + black

ColorBrewer Schemes

41

CB-Accent

42

CB-Dark2

43

CB-Paired

44

CB-Pastel1

45

CB-Pastel2

46

CB-Set1

47

CB-Set2

48

CB-Set3

49

CB-Blues

50

CB-BuGn

51

CB-BuPu

52

CB-GnBu

53

CB-Greens

54

CB-Greys

55

CB-Oranges

56

CB-OrRd

57

CB-PuBu

58

CB-PuBuGn

59

CB-PuRd

60

CB-Purples

61

CB-RdPu

62

CB-Reds

63

CB-YlGn

64

CB-YlGnBu

65

CB-YlOrBr

66

CB-BrBG

67

CB-PiYG

68

CB-PRGn

69

CB-PuOr

70

CB-RdBu

71

CB-RdGy

72

CB-RdYlBu

73

CB-RdYlGn

74

CB-Spectral

Tip: If you are running IDL on a TrueColor display, set DEVICE, DECOMPOSED = 0 before using your first color table-related routine in an IDL session or program.

Load a default color table as follows:

  • IDL functions: For functions that include the RGB_TABLE property, enter the index number. If you do not define a color table, these graphics display in gray scale.
  • iImage: In the IDL iImage dialog, click Edit Palette on the Image panel.
  • Object Graphics: Use the LoadCT method of an IDLgrPalette object to define the color table (see IDLgrPalette::LoadCT for details). Associate the palette object with another object using the Palette property (for example, see the PALETTE property of the IDLgrImage object).
  • Direct Graphics: Use the LOADCT Procedure or another color table-related routine to set the color table.

See Color Table Manipulation for a list of related routines.

Modifying and Converting Color Tables


IDL contains two graphical user interface (GUI) utilities for modifying a color table: XLOADCT and XPALETTE. The MODIFYCT routine lets you create or modify and store a new color table. See the following topics for examples:

  • XLOADCT Procedure: Allows you to preview and select among predefined color tables.
  • XPALETTE Procedure: Allows you to preview and adjust predefined color tables.
  • MODIFYCT Procedure: Shows how to add modified color tables to IDL’s list of predefined color tables.

These examples are based on the default RGB (red, green, and blue) color system. IDL also contains routines that allow you to use other color systems including hue, saturation, and value (HSV) and hue, lightness, and saturation (HLS).

Highlighting Features with a Color Table


For indexed images, custom color tables can be derived to highlight specific features. Color tables are usually designed to vary within certain ranges to show dramatic changes within an image. Some color tables are designed to highlight features with drastic color change in adjacent ranges (for example setting 0 through 20 to black and setting 21 through 40 to white).

Color tables are associated with indexed images. RGB images already contain their own color information. To derive a color table for an RGB image, convert it to an indexed image with the COLOR_QUAN routine. Also, set the COLOR_QUAN CUBE keyword to 6 to ensure the resulting indexed image is an intensity representation of the original RGB image. See COLOR_QUAN for more information.

The following topics include examples:

  • IDLgrPalette provides an example that creates, defines and applies a palette object to an image.
  • TVLCT Procedure creates, defines, and applies a color table in a Direct Graphics display.
  • H_EQ_CT applies histogram equalization to a color table to reveal previously indistinguishable feature.