Digital image processing tutorials and interactive applets
Color lookup tables (CLUTs)
Humans perceive color through wavelength-sensitive sensory cells called cones. There are three different types of cones, each with a different sensitivity to electromagnetic radiation (light) of different wavelength. One type of cone is mainly sensitive to red light, one to green light, and one to blue light. By emitting a controlled combination of these three basic colors (red,green and blue), and hence stimulate the three types of cones at will, we are able to generate almost any perceivable color. This is the reasoning behind why color images are often stored as three separate image matrices; one storing the amount of red (R) in each pixel, one the amount of green (G) and one the amount of blue (B). We call such color images as stored in an RGB format.
Typically each such color pixel is stored using three 8-bit bytes; or sometimes using an even higher number of bits per color channel. To reduce the number of bytes needed to store a full color image, the color value of each pixel can be stored as an index into a list of predefined colors, i.e., each pixel is merely a "pointer" to a color. If the list of available colors is short, fewer bits need to be store for each pixel, which in turn leads to smaller image files.
The applet above explores some common ways to generate color tables. One of the approaches is non-adaptive (it is independent of the actual image we want to create the table for), and does a simple equal-sized partitioning of the RGB-cube. All pixels within each partition get set to the same color. The other approaches are adaptive; one called the median cut, and one k-means clustering. For more on these approaches, see the related links.
Click the images on the upper right to change the image being processed. Use the radio buttons to pick the approach for generating the color table, and the number of colors in it. Note that the starting point for the applied k-means clustering algorithm is random, hence you might get different results when repeating.
Commentscomments powered by Disqus
ImageProcessingBasics.com © 2008-2019