Colors



For colors, 8-bits and 24-bits are common. Eight bits can represent 2^8 = 256-colors. The 24-bits can represent 2^24 = 16.7 million colors. Often the 8-bit color is adequate.

Because colors are composed of the primary colors - red, green and blue, 24-bit colors are sometimes stored as 3 sets of 8 bits. This is referred to as rgb encoding.

Another techniques, especially for 8-bit color, is to choose a palette. That is, a set of colors is chosen to be used for the picture. Each 8-bit number represents one of those colors in the palette.

Improvements for 8-bit picture storage can be made by judicious picking of the color palette. This is done by analyzing what colors are used most often in the picture. Of course, this is also why colors vary from machine to machine.

RGB Color by Prof Ed Cox

More by Prof Cox


Send questions and comments to: Karen Lemone