Sunday, May 11, 2008

What is a Web safe color palette

Color can be used effectively in Web design to enhance a Web site’s usability, including its visual presentation, structure, functionality and accessibility. The colors used in designing Web pages are known as Web colors.
Each color is represented in the computer by a number and the set of colors contained in an image is called its color palette. In the Red Green Blue (RGB) color model, colors can be specified as a RGB triplet. The colors RGB are known as additive primary colors because any color can be produced by combining red, blue and green light in varying proportions. A color is represented as a triplet of three numerical values, each of which specifies the amount of red, green and blue colors respectively that make up the given color. The numerical value is a number between 0 and 255, which can fit into a single byte, resulting in 24 bits for each color. For example, red would be given as (255, 0, 0). Dark emerald green which is made up of a 71% green component and a 21% blue component is represented as (0, 71, 29).
Having 24 bits for each color means that 16.7 million possible colors can be represented. However, not all images use that many colors.

Computers use values in the range 0 to 255, each of which will fit into a single byte. A simple expedient known as indexed color is often used to reduce the space required by images, so that they can be transmitted over networks more efficiently. Indexed color images may be displayed with the assistance of hardware: the color table stored in the image is loaded into an associative memory, known as a color lookup table (CLUT), so that colors can be looked up rapidly.
To reduce the space required to store each color, indexed colors are used. In this scheme, if the image has less than 256 colors, then a single byte is sufficient for representing each color. A color mapping table is used to translate from this smaller number to the actual 24-bit color value. Indexed color images may be displayed with the assistance of hardware: the color table stored in the image is loaded into an associative memory, known as a color lookup table (CLUT), so that colors can be looked up rapidly.

The set of colors contained in an image is called its color palette. If it is vital that the display of indexed color images is correct, it is better to restrict the choice of Web colors to the Web safe color palette of 216 colors which are common to the system palettes of the major operating systems. This set of colors is called the Web-safe palette. Programs, like Adobe Photoshop, used for preparing images for the Web will allow you to select the Web-safe palette when exporting your image to one of the Web file formats. If an image uses non safe colors, a system capable of handling only 256 colors, may resort to replacement of similar hue colors with one color resulting in posterization or dithering of the image.

No comments: