07 Image Compression - PDF
07 Image Compression - PDF
Technology (NUST)
School of Electrical Engineering and Computer Science
(SEECS)
Principal objective
To minimize the number of bits required to represent an image
Applications
Transmission: Broadcast TV, remote sensing via satellite, military
communications via aircraft, radar and sonar, teleconferencing, computer
communications, …
• Compression
– Reducing the amount of data to represent a given quantity of information
6
Khawar Khurshid, 2012
Relative Data Redundancy
if b = b’, C = 1 and R = 0, relative to the second data set, the first set
contains no redundant data
if b >> b’, C ∞ and R 1, relative to the second data set, the first set
contains highly redundant data
if b << b’, C 0 and R -∞, relative to the second data set, the first set is
highly compressed
7
C = 10 means 90% of the data in the first data set is redundant
Khawar Khurshid, 2012
Data Redundancy
8
Khawar Khurshid, 2012
Spatial Redundancy
• Image features
– All 256 gray levels are equally
probable uniform histogram
(variable length coding can not
be applied)
– The gray levels of each line are
selected randomly so pixels are
independent of one another in
A computer generated
vertical direction
(synthetic) 8-bit image
– Pixels along each line are M = N = 256
identical, they are completely
dependent on one another in
horizontal direction
Spatial redundancy
9
Khawar Khurshid, 2012
Spatial Redundancy
256 x 256 x 8
– Compression Ratio = 128
[256 256] x 8
10
Khawar Khurshid, 2012
Coding Redundancy
• A natural m-bit coding method assigns m-bit to each gray level without
considering the probability that gray level occurs
very likely to contain coding redundancy
• Basic concept?
– Utilize the probability of occurrence of each gray level (histogram) to
determine length of code representing that particular gray level:
variable-length coding
– Assign shorter code words to the gray levels that occur most
frequently or vice versa
11
Khawar Khurshid, 2012
Coding Redundancy
Hence, the total number of bits required to code and MxN pixel image is MNLavg
For a natural m-bit coding Lavg= m
12
Khawar Khurshid, 2012
Coding Redundancy - Example
• Code 1: Natural code (m = 8) is used,
Lavg = 8 bits
13
Khawar Khurshid, 2012
Coding Redundancy – Example
14
Khawar Khurshid, 2012
Irrelevant Information
• Quantization
16
Khawar Khurshid, 2012
Redundancy
• Compression Ratio?
• Relative Redundancy?
18
Khawar Khurshid, 2012