next up previous
Next: Computer Graphics File Up: Web Graphics is Previous: Pixel Graphics

Color Representation

This section introduces different ways to represent colors in computer graphics. As there are several ways to store computer images in files and various methods to display them in different qualities, one needs to know some of its background. I will mostly use Photoshop's terminology for image modes and color modes.

Bitmaps:
Bitmaps are black and white images. Black drawing on white background or white drawing on black background are the only options in this mode. No colors can be used or set.
Indexed Color:
  Indexed color mode implies a limited number of colors available for pixels. A color table (or palette) assigns a color number to a color value:

Usually, the color description is not a color name, but made up of so-called RGB values (see below). Technically, every pixel in a indexed color mode image is assigned a color number, and by manipulation of the color values, one can change all pixels of this color at the same time. A smiley with black eyes on purple background, presented as color numbers, would look like this:

          1111111111111111
          1111333111333111
          1111111111111111
          1111333111333111
          1111111333111111
          1111111111111111

To change the eye color to yellow, it is not necessary to replace all the 3's by 0's, is would be sufficient to alter color table entry number 3 from black to yellow.

RGB:
  RGB is for Red-Green-Blue mode. Each pixel on the computer screen has three color values associated with it: a red, a green and a blue color value. The three mixed as additive colors make up the color on the computer screen. The usual range of color values is 0 to 255, and so a pixel can have about 16 millions of colors.
CMYK:
This color mode is similar to RGB, but uses the color separation from printing: Cyan, Magenta, Yellow, blaK. Be aware that in programs like Photoshop, the setting of mode influences the way the paint tools spread color.

A detailed overview of color modes in computer graphics can be found in chapter 3 of [2].



next up previous
Next: Computer Graphics File Up: Web Graphics is Previous: Pixel Graphics



Lothar Fritsch
Fri May 3 22:43:31 MET DST 1996