Chapter 1 SupplimentaryReading
Chapter 1 SupplimentaryReading
DIRECT CODING
Image representation is essentially the representation of pixel colors. Using direct coding we
allocate a certain amount of storage space for each pixel to code its color. This 3-bit
representation allows each primary to vary independently between two intensity levels: 0
(off) or 1 (on). Hence each pixel can take on one of the eight colors that correspond to the
corners of the RGB color cube.
A widely accepted industry standard uses 3 bytes, or 24 bits, per pixel, with one byte for
each primary color. This way we allow each primary color to have 256 different intensity
levels, corresponding to binary values from 00000000 to 11111111. Thus a pixel can take on
a color from 256 x 256 x 256 or 16.7 million possible choices. This 24-bit format is commonly
referred to as the true color representation, for the difference between two colors that differ
by one intensity level in one or more of the primaries is virtually undetectable under normal
viewing conditions. Hence a more precise representation involving more bits is of little use in
terms of perceived color accuracy.
A notable special case of direct coding is the representation of black-and-white (bilevel) and
gray-scale images, where the three primaries always have the same value and hence need
not be coded separately. A black-and-white image requires only one bit per pixel, with bit
value 0 representing black and 1 representing white. A gray-scale image is typically coded
with 8 bits per pixel to allow a total of 256 intensity or gray levels.
LOOKUP TABLE
Image representation using a lookup table can be viewed as a compromise between our
desire to have a lower storage requirement and our need to support a reasonably sufficient
number of simultaneous colors. In this approach pixel values do not code colors directly.
Instead, they are addresses or indices into a table of color values. The color of a particular
pixel is determined by the color value in the table entry that the value of the pixel
references. Figure 2-4 shows a lookup table with 256 entries. The entries have addresses 0
through 255. Each entry contains a 24-bit RGB color value. Pixel values are now 1 -byte, or
8-bit, quantities. The color of a pixel whose value is /, where 0 < / < 255, is determined by
the color value in the table entry whose address is /. This 24-bit 256-entry lookup table
representation is often referred to as the 8-bit format. It reduces the storage requirement of
a 1000 x 1000 image to one million bytes plus 768 bytes for the color values in the lookup
table. It allows 256 simultaneous colors that are chosen from 16.7 million possible colors. It
is important to remember that, using the lookup table representation, an image is defined
not only by its pixel values but also by the color values in the corresponding lookup table.
Those color values form a color map for the image.
HALFTONE APPROXIMATION
Instead of changing dot size we can approximate the halftone technique using pixel-grid
patterns. We can increase the number of overall intensity levels by increasing the size of the
pixel grid. On the other hand, if the pixels can be set to multiple intensity levels, even a 2 x
2 grid can produce a relatively high number of overall intensity levels. These halftone grid
patterns are sometimes referred to as dither patterns. There are several considerations in
the design of dither patterns.
IMAGE FILES
A digital image is often encoded in the form of a binary file for the purpose of storage and
transmission. Among the numerous encoding formats are BMP (Windows Bitmap), JPEG (Joint
Photographic Experts Group File Interchange Format), and TIFF (Tagged Image File Format).
Although these formats differ in technical details, they share structural similarities. The file
consists largely of two parts: header and image data. In the beginning of the file header a
binary code or ASCII string identifies the format being used, possibly along with the version
number. The width and height of the image are given in numbers of pixels. Common image
types include black and white (1 bit per pixel), 8-bit gray scale (256 levels along the gray
axis), 8-bit color (lookup table), and 24-bit color.