There are many digital image representation such as raster and vector format. The raster type represent the image in pixels, while vector type represent the image in vector notation (curve, line, circle, etc). Only raster type will be discussed here. Raster image is constructed by many pixels, where each pixel is arranged in rows and columns. Each pixel can be addressed by its Cartesian coordinate. Within raster image, there are some very popular formats: binary, gray scale, true color, and indexed color.
Binary Image
In binary image, there are only two values: 0 or 1, representing two different colors. Most common color mapping is black for 0 and white for 1. Example of binary image is shown in figure 1.
Figure 1. Binary Image
In a color image, a specific color of a pixel is represented as a combination of three primary color: red, green, and blue (RGB), therefor this true color format is also known as RGB format. This RGB primary color is using display format, where the display device normally has red, green, and blue light source to construct a pixel. This is different with printing based representation that normally uses cyan, magenta, and yellow (CMY) as their primary color, as used by printing devices. For 24-bit RGB format, each element (red, green, and blue) uses 8 bit depth to represent its intensity, so there are 2^24 or more than 16 million of possible color value for each pixel. An example of true color image is shown in figure 3.
Figure 3. A True Color Image
Binary Image
In binary image, there are only two values: 0 or 1, representing two different colors. Most common color mapping is black for 0 and white for 1. Example of binary image is shown in figure 1.
Figure 1. Binary ImageGray Scale
Using gray scale, the intensity of a pixel can vary in many values, giving smoother image. Each pixel can has many possible values, depending on the bit-depth of the format, for example, an 8 bit gray scale has 256 possible value for each pixel to represent the dot intensity. The most common color mapping for gray scale is black for 0 (zero) value, white for maximum value (255 in case of 8-bit image), and gray for values in between. Other color mapping is possible such as dark brown for zero and light orange for maximum value. An example of a gray scale image is shown in figure 2.
Figure 2. Gray Scale Image
True Color ImageIn a color image, a specific color of a pixel is represented as a combination of three primary color: red, green, and blue (RGB), therefor this true color format is also known as RGB format. This RGB primary color is using display format, where the display device normally has red, green, and blue light source to construct a pixel. This is different with printing based representation that normally uses cyan, magenta, and yellow (CMY) as their primary color, as used by printing devices. For 24-bit RGB format, each element (red, green, and blue) uses 8 bit depth to represent its intensity, so there are 2^24 or more than 16 million of possible color value for each pixel. An example of true color image is shown in figure 3.
Figure 3. A True Color ImageIndexed Color Image
The memory to store a true color image is three times than to store gray-scale image. Inpractical image, the number of colors is often limited, much less than 16 million combination, because the number of color in an image can't exceed the number of its pixels. Even if the number of pixels exceed 16 million, the number of colors can be much less. To reserve the computer's storage memory, an indexed color format is used for this case. In this format, each pixel is represent an index of a color table.


The memory to store a true color image is three times than to store gray-scale image. Inpractical image, the number of colors is often limited, much less than 16 million combination, because the number of color in an image can't exceed the number of its pixels. Even if the number of pixels exceed 16 million, the number of colors can be much less. To reserve the computer's storage memory, an indexed color format is used for this case. In this format, each pixel is represent an index of a color table.


Figure 4. Indexed Color Image and Its Colormap
This color table is known as color pallet or color map. Using this format, we can manipulate the color in all pixels faster, because we just need to manipulate the color map, which have much fewer element that the pixels. Figure 4 is a typical indexed 256-color image and its own palette (shown as a rectangle of swatches).

0 comments:
Post a Comment