[Home]  [Edit this page]  [Recent Changes]  [Special Pages]  [Help
palette

Color palette

Color palettes are used in the computer world when there is the need to lower graphics memory consumption.

Older systems used palettized display resolutions to save some video memory, when it was rare to see a display adapter with more than 512 KB of memory. In today's world, palettized images are used all over the Internet, as their lower "weight" makes them perfect for quick downloads (the GIF image format is a palettized image format).

How color palettes work

How they work is pretty simple and mostly intuitive: where a truecolor (non-palettized) image stores the red, green and blue components of each pixel in the image, a palettized image is stored along with a table of the colors used to display it (referred to as "color palette"), and each pixel is just an  ?index to this table. If the color palette is reduced in size, a pixel can be as little as log2(colors-in-palette) bytes, so each pixel in a 16-colors image will only take up half a byte, or 4 bits.
This clearly becomes an advantage in case of big pictures: if a color takes 4 bytes of storage, an 800 by 600 picture will consume little less than 800 x 600 x 4 = 2 MB; the same image, stored as a 256-color (8bit) palettized image, would take up (4 x 256) + (800 x 600 x 1) = 470 KB; less than a quarter of the size of the original image!

Then why non-palettized images?

Palettized images impose strict limitations over the total number of colors in the image, which can be indeed very critical if we think of photos. So palettized images are most often used to store simple graphics or images the artist took care to draw using as few colors as possible.

last edited (February 5, 2003) by KDivad Leahcim, Number of views: 2320, Current Rev: 4 (Diff)

[Edit this page]  [Page history]  [What links here]  [Discuss this topic]  [Printer Friendly]  

Members

Username:

Password:


Register
Forgot Password?




Programmers Heaven - for .NET, Java, C/C++ and WEB Developers!
© 1996-2008 Community Networks Ltd. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Development by Tore Nestenius at .NET Consultant - Synchron Data.