Unit 5: Image Compression: © 2002 R. C. Gonzalez & R. E. Woods
Unit 5: Image Compression: © 2002 R. C. Gonzalez & R. E. Woods
com
•Fundamentals
•Redundancies
•Fidelity criteria
•Image Compression Models
•Error free compression
•Lossy Compression
•Image compression Standards :Binary Image &
continuous tone still image compression standards
•Video compression standards
Image Compression
Image Compression
Image Compression
Image Compression
Fidelity criteria
Objective Fidelity criteria
Chapter 8
Image Compression
• Huffman Coding
• LZW Coding
• Bit Plane Coding
•Constant Area Coding
• Run length coding
•Lossless Predictive Coding
Chapter 8
Image Compression
Another Method
© 2002 R. C. Gonzalez & R. E. Woods
Digital Image Processing, 2nd ed. www.imageprocessingbook.com
Assignment :
Q1 Generate the IGS code for following gray level values
of pixels.
100,120,130,170,160,110
A=20,B=30,C=10,D=0,E=10,F=20,G=10
LZW Coding
LZW Coding
The Algorithm:
•A codebook or “dictionary” containing the source symbols
is constructed.
LZW Coding
LZW Coding
Decoding LZW:
Let the bit stream received be:
39 39 126 126 256 258 260 259 257 126
In LZW, the dictionary which was used for encoding need not be
sent with the image. A separate dictionary is built by the
decoder, on the “fly”, as it reads the received code words.
Eg: Let us say one pixel has a gray level of 127 and the next pixel has
a gray level of 128.
In binary: 127 = 01111111
& 128 = 10000000
Therefore a small change in gray level has decreased the run-lengths in
all the bit-planes!
© 2002 R. C. Gonzalez & R. E. Woods
Digital Image Processing, 2nd ed. www.imageprocessingbook.com
GRAY CODE
•Gray coded images are free of this problem which
affects images which are in binary format.
• In gray code the representation of adjacent gray
levels will differ only in one bit (unlike binary
format where all the bits can change.
Chapter 8
Image Compression
ˆ
en f n f n
Decompression:
f n en fˆn
Most general
ˆf round f
m
i n i
form :
n
i 1
ˆf f
n n 1
© 2002 R. C. Gonzalez & R. E. Woods
Digital Image Processing, 2nd ed. www.imageprocessingbook.com
Lossy compression
•Lossless compression usually gives a maximum compression of 3:1
(for monochrome images)
•Lossy compression can give compression upto 100:1 (for
recognizable monochrome images) 50:1 for virtually indistinguishable
images
•The popular JPEG (Joint Photographic Experts Group) format uses
lossy transform-based compression.
Assignment
Arithmetic Coding
• Arithmetic coding bypasses the idea of replacing an
input symbol with a specific code. It replaces a
stream of input symbols with a single floating-point
output number.
• Arithmetic coding is especially useful when dealing
with sources with small alphabets, such as binary
sources, and alphabets with highly skewed
probabilities.
Arithmetic Coding