Method 1

First, determine how many bits to create index tables. For example, 8 bits for the lookup index table. 3 bits for Red, 3 bits for Green, 2 bits for Blue. For example, red Component will be divided into 8 segments. See the following table.

The pixel range from the image 0-31 32-63 64 - 95 96 - 127 128-159 160-191 192-223 224-255
The pixel is used for representingthis color range 16 48 80 112 140 176 208 240


The color is changed to 16 pixel if the value for red component ranges from 0-31. The color is changed to 48 pixel to represent the color if the value for red component ranges from 32 - 63.

Method 2 (median-cut algorithms)

First, find the median of the color in the photo for the specific color channel such as Red. Second select the color below or over the median of the color. Third, represent as the index of the lookup table by using the mean of the color for the specific color channel such as Red. Repeat this process for the Green, Blue component until the number of the index are formed. For example, the number of the index is 64. If value in the medium and cut algorithms is 64, it means 64 ( 26 ) index are created.