Datasheet

AN1368
DS01368A-page 28 2011 Microchip Technology Inc.
APPENDIX A: COLOR LOOK-UP
TABLE (CLUT)
A Recap of Basic Concepts
Before understanding the concept of a CLUT, image
representations and their data types should be
understood.
A digital image consists of pixels, also known as Pels.
This is a binary image (‘0’ or ‘1’) and is represented by
a simple on/off of a pixel. It is also called a
monochrome image, and for a 640x480 screen size,
the image size is (640x480/8) 37.5 Kbytes.
Image resolution refers to the number of pixels in an
image. Aspect ratio is the ratio of the column/row. In the
above example of 640x480, the aspect ratio is 4:3. This
above aspect ratio has been found to appear as a
natural image.
8-Bit Gray Level Image
An 8-bit image is an image where each pixel has an 8-bit
value (0-255) represented by a byte, which is also known
as Grayscale. Thus, the image can be a 2-dimensional
array of values, ranging between (0-255), which is also
referred to as a bit map.
For Example: An 8-bit Grayscale of VGA resolution
would be the size of 300 Kbytes.
Image Data Type for Color Images
The common data type for graphics and image file
formats is 24-bit color or 8-bit color. In a 24-bit color
image data type, each pixel is represented by three
bytes, one for the RGB of each primary color. The other
colors are represented as a combination of the RGB
values. Because each value is in the range of 0-255, it
provides a total of 16,777,216 possible colors; however,
this requires a huge storage memory (16 Mbytes).
For example, for a resolution of 640x480, a 24-bit color
image would require 900 Kbytes of memory (without
any compression).
If memory space is a concern (which is generally the
case), by quantizing the 24-bit color information,
reasonably accurate 8-bit color information can be
achieved. This also means that we have only
256 possible colors.
8-Bit Color Image Files
Image files use a special concept to store color
information in a CLUT. The image is not represented by
colors but a set of bytes. These bytes form the index to
a table, which has 3-byte values that specify the color
for a pixel. This means the user has to represent the
image by choosing the colors that best represent the
image and does not exceed the 256 color
combinations, as they are indexed by 8-bit values.
One important savings of 8-bit representation over 24-bit
representation is in storage space, which is 300 Kbytes
vs. 900 Kbytes (with no compression applied).
Figure A-1 can help in understanding the CLUT, which
is also known as a palette table.
FIGURE A-1: COLOR LOOK-UP TABLE (CLUT)
1 Pixel
Color 0
Color 21
210 200 9
R G B
CLUT
0
1
2
3
21 Color Value
.
.
Value = 21