Computer Graphics and Multimedia Notes Unit 4
Computer Graphics and Multimedia Notes Unit 4
White Black
Run Code Run Code
Length Word Length Word
0 00110101 0 0000110111
1 000111 1 010
2 0111 2 11
3 1000 3 10
4 1011 4 011
5 1100 5 0011
6 1110 6 0010
7 1111 7 00011
8 10011 8 000101
9 10100 9 000100
10 00111 10 0000100
11 01000 10 0000100
11 01000 11 0000101
12 001000 12 0000111
13 000011 13 00000100
14 110100 14 00000111
15 110101 15 000011000
16 101010 16 0000010111
17 101011 17 0000011000
18 0100111 18 0000001000
19 0001100 19 00001100111
20 0001000 20 00001101000
21 0010111 21 00001101100
22 0000011 22 00000110111
23 0000100 23 00000101000
24 0101000 24 00000010111
25 0101011 25 00000011000
26 0010011 26 000011001010
27 0100100 27 000011001011
28 0011000 28 000011001100
29 00000010 29 000011001101
30 00000011 30 000001101000
31 00011010 31 000001101001
32 00011011 32 000001101010
33 00010010 33 000001101011
34 00010011 34 000011010010
35 00010100 35 000011010011
Table 1:Run-Length Codes for CCITT Group
For example, from Table, the run-length code of 16 white pixels is 101010, and of 16 black
pixels 0000010111. Statistically, the occurrence of 16 white pixels is more frequent than the
occurrence of 16 black pixels. Hence, the code generated for 16 white pixels is much shorter.
This allows for quicker decoding. For this example, the tree structure could be constructed.
36 00010101 36 000011010100
37 00010110 37 000011010101
38 00010111 38 000011010110
39 00101000 39 000011010111
40 00101001 40 000001101100
41 00101010 41 000001101101
42 00101011 42 000011011010
43 00101100 43 000011011011
44 00101101 44 000001010100
45 00000100 45 000001010101
46 00000101 46 000001010110
47 00001010 47 000001010111
48 00001011 48 000001100100
49 01010010 49 000001100101
50 01010011 50 000001010010
51 01010100 51 000001010010
52 01010101 52 000000100100
53 00100100 53 000000110111
Table 1:Run-Length Codes for CCITT Group
The codes greater than a string of 1792 pixels are identical for black and white pixels. A new
code indicates reversal of color, that is, the pixel Color code is relative to the color of the
previous pixel sequence.
Table below shows the codes for pixel sequences larger than 1792 pixels.
Note that the file is terminated by a number of EOLs (End of. Line) if there is no change in the
line from the previous line (for example, white space).
Color Characteristics
We typically define color by its brightness, the hue and depth of color.
Luminance or Brightness
This is the measure of the brightness of the light emitted or reflected by an object; it depends
on the radiant, energy of the color band.
Hue
This is the color sensation produced in an observer due to the presence of certain wavelengths
of color. Each wavelength represents a different hue.
Saturation
This is a measure of color intensity, for example, the difference between red and pink.
Color Models
Several color models have been developed to represent color mathematically.
Chromacity Model
It is a three-dimensional model with two dimensions, x and y, defining the color, and the third
dimension defining the luminance. It is an additive model since x and yare added to generate
different colors.
RGB Model
RGB means Red Green Blue. This model implements additive theory in that different
intensities of red, green and blue are added to generate various colors.
HSI Model
The Hue Saturation and Intensity (HSI) model represents an artist's impression of tint, shade
and tone. This model has proved suitable for image processing for filtering and smoothing
images.
CMYK Model
The Cyan, Magenta, Yellow and Black color model is used in desktop publishing printing
devices. It is a color-subtractive model and is best used in color printing devices only.
YUV Representation The NTSC developed the YUV three-dimensional color model.
y -Luminance Component UV -Chrominance Components. Luminance component contains
the black and white or grayscale information. The chrominance component contains color
information where U is red minus cyan and V is megenta minus green.
YUV Model for JPEG
The JPEG compression scheme uses several stages. The first stage converts the signal from the
spatial RGB domain to the YUV frequency domain by performing discrete cosine transform.
This process allows separating luminance or gray-scale components from the chrominance
components of the image.
AC
ZIG ZAG
HUFFMAN
AC ENCODER
DC
DC HUFFMAN IDPCM
IDCT
AC HUFFMAN
AC DECODER
Figure: Symmetric Operation of DCT Based Codec.
The JPEG method is a symmetric algorithm. Here, decompression is the exact reverse process
of compression. Figure describes a typical DCT based encoder and decoder.
8X8 IMAGE
BLOCK
DCT QUANTIZER ENTROPY
QUANTIZER HUFFMAN
TABLE TABLE