Palette Size
The palette itself stores a limited number of distinct colors; 4, 16 or 256 are the most common cases. These limits are often imposed by the target architecture's display adapter hardware, so it is not a coincidence that those numbers are exact powers of two (the binary code): 22 = 4, 24 = 16 and 28 = 256. While 256 values can be fit into a single 8-bit byte (and then a single indexed color pixel also occupies a single byte), pixel indices with 16 (4-bit, a nibble) or fewer colors can be packed together into a single byte (two nibbles per byte, if 16 colors are employed, or four 2-bit pixels per byte if using 4 colors). Sometimes, 1-bit (2-color) values can be used, and then up to eight pixels can be packed into a single byte; such images are considered binary images (sometimes referred as a bitmap or bilevel image) and not an indexed color image.
Color depth |
---|
|
Related |
|
If simple video overlay is intended through a transparent color, one palette entry is specifically reserved for this purpose, and it is discounted as an available color. Some machines, such as the MSX series, had the transparent color reserved by hardware.
Indexed color images with palette sizes beyond 256 entries are rare. The practical limit is around 12-bit per pixel, 4,096 different indices. To use indexed 16 bpp or more does not provide the benefits of the indexed color images' nature, due to the color palette size in bytes being greater than the raw image data itself. Also, useful direct RGB Highcolor modes can be used from 15 bpp and up.
If an image has many subtle color shades, it is necessary to select a limited repertoire of colors to approximate the image using color quantization. Such a palette is frequently insufficient to represent the image accurately; difficult-to-reproduce features such as gradients will appear blocky or as strips (color banding). In those cases, it is usual to employ dithering, which mixes different-colored pixels in patterns, exploiting the tendency of human vision to blur nearby pixels together, giving a result visually closer to the original one.
Here is a typical indexed 256-color image and its own palette (shown as a rectangle of swatches):
Read more about this topic: Indexed Color
Famous quotes containing the words palette and/or size:
“The great God endows His children variously. To some he gives intellectand they move the earth. To some he allots heartand the beating pulse of humanity is theirs. But to some He gives only a soul, without intelligenceand these, who never grow up, but remain always His children, are Gods fools, kindly, elemental, simple, as if from His palette the Artist of all had taken one color instead of many.”
—Mary Roberts Rinehart (18761958)
“There are some persons we could not cut down to size without diminishing ourselves as well.”
—Jean Rostand (18941977)