Image Color Indexing

In reality PC-monitors, printesr, scanners and various other devices cannot produce the infinite number of colors represented by a color model like RGB. The main limiting factor is the available (video) memory space. Only a limited number of bits can be used per pixel. The most common values are:

  • 8 bits/pixel (256 colors),
  • 16 bits/pixel (65536 colors)
  • 18 bits/pixel (VGA, 262 144) or
  • 24 bits/pixel (SVGA, 16 777 216)
  • With, for example, 24 bits/pixel the pixel values for each of the three components (RGB) are between 0 - 255, where zero represents the zero value and 255 represents the value of one in the RGB model. In color monitors, every pixel value of an image is stored in a frame buffer.The available pixel values are indexed to a color index table, which can be CMAP, LUT or PALETTE.

    CMAP

    The display or printer device has a color map, which defines the colors available and the pixel values for each color in the map. If the pixel value is not defined in the color map, usually the nearest similar color is displayed or printed. Usually up to 256 colors are defined in CMAP tables. In most cases the pixel value for each color can also be changed by the user.

    LUT

    Look-Up Table. The (RGB) pixel value is an index to a look-up table. There are as many index values as there are pixel values. This index value is then used for controlling the displaying or printing process rather than the pixel value itself.

    Palette

    Each pixel value is an index to three separate palette index arrays, one for each component (Red, Green and Blue). This way the look-up table can be much smaller. For example, if there is 8 bits/comp. (24 bits/pixel) available : 8^2 = 256, 256 *3 = 768 array elements. Otherwise, there should be 16777216 elements in the Look-Up Table! Palette arrays are then used directly to control the electron beam intensities in a monitor. VGA- and SVGA-monitors use this system.

    VGA-monitor Palette system