What is color quantization?
Many people don’t have full-color (24 bit per pixel) display hardware. Inexpensive display hardware stores 8 bits per pixel, so it can display at most 256 distinct colors at a time. To display a full-color image, the computer must choose an appropriate set of representative colors and map the image into these colors. This process is called “color quantization”. (This is something of a misnomer; “color selection” or “color reduction” would be a better term. But we’re stuck with the standard usage.) Clearly, color quantization is a lossy process. It turns out that for most images, the details of the color quantization algorithm have *much* more impact on the final image quality than do any errors introduced by JPEG itself (except at the very lowest JPEG quality settings). Making a good color quantization method is a black art, and no single algorithm is best for all images. Since JPEG is a full-color format, displaying a color JPEG image on 8-bit-or-less hardware requires color quantizat