Image Compression
Image Compression
1. Transmission
2. Storage
4/18/2025 Dr. Nilamani Bhoi, Associate Professor, ETC Engg, VSSUT Burla 2
Performance measures of image compression
Bits/pixel:
It is defined as the number of bits required to represent a single pixel.
Image Compression
Compression ratio:
It is the ratio of the size of original image to the size of compressed image
Example:
Consider 8-bit image of 256×256 pixels. After compression, the size is
6554 bytes. Find the compression ratio and bits/pixel.
Ans:
Compression ratio= 10:1
Bits/pixel=0.8
4/18/2025 Dr. Nilamani Bhoi, Associate Professor, ETC Engg, VSSUT Burla 3
Compression is possible due to redundancies present in image.
CR = Compression Ratio
4/18/2025 Dr. Nilamani Bhoi, Associate Professor, ETC Engg, VSSUT Burla 4
Image Compression
4/18/2025 Dr. Nilamani Bhoi, Associate Professor, ETC Engg, VSSUT Burla 5
Interpixel redundancy
Interpixel redundancy is due to the correlation between the nieghboring pixel.
Image Compression
The interpixel redundancies are achieved by transforming the image into other
domain such as DCT, DWT, etc.
0 0 0 0 0 0 0 0
0 200 165 167 166 169 171 172
0 206 164 167 171 175 174 175
161 160 160 159 159 159 158 159 0 211 165 168 174 173 177 175
161 161 160 159 159 158 159 160 0 209 167 171 170 175 174 174
163 162 161 160 159 160 161 161 Beginning 8×8 pixels 0 209 166 169 172 171 173 173
Beginning 8×8 pixels
163 163 162 161 160 160 161 160 0 204 162 170 174 176 175 178
162 162 160 160 160 159 159 160 0 208 166 172 174 172 173 172
162 161 160 158 158 158 158 160
160 159 158 157 158 157 157 157
159 158 157 157 156 156 156 157
4/18/2025 Dr. Nilamani Bhoi, Associate Professor, ETC Engg, VSSUT Burla 6
Psychovisual redundancy
Human eye does not respond to all visual information with equal sensitivity.
Image Compression
Removing this type of redundancy is a lossy process and the lost information can
not be recovered.
The method used to remove this type of redundancy is called quantization which
means the mapping of broad range of input values to a limited number of output
values.
4/18/2025 Dr. Nilamani Bhoi, Associate Professor, ETC Engg, VSSUT Burla 7
Psychovisual redundancy
Image Compression
4/18/2025 Dr. Nilamani Bhoi, Associate Professor, ETC Engg, VSSUT Burla 8
Image Compression Psychovisual redundancy
(b)
(a)
(a)Original Image
(b) Uniform quantization to 16 levels
(c)IGS quantization to 16 levels
(c)
4/18/2025 Dr. Nilamani Bhoi, Associate Professor, ETC Engg, VSSUT Burla 9
Image Compression
4/18/2025 Dr. Nilamani Bhoi, Associate Professor, ETC Engg, VSSUT Burla 10
Coding redundancy
4/18/2025 Dr. Nilamani Bhoi, Associate Professor, ETC Engg, VSSUT Burla 11
Coding Techniques
Most frequently used coding are run length coding and Huffman
coding
4/18/2025 Dr. Nilamani Bhoi, Associate Professor, ETC Engg, VSSUT Burla 12
Run length coding
In this code, every code ward is made up of a pair (g,l) where g is the gray
level, and l is the number of pixels with that gray level (length or ‘run’).
Image Compression
Exp:
4/18/2025 Dr. Nilamani Bhoi, Associate Professor, ETC Engg, VSSUT Burla 13
Huffman coding
In this code shorter code wards are assigned to most frequently occurring
gray levels and longer code wards to less frequently occurring gray levels.
Image Compression
4/18/2025 Dr. Nilamani Bhoi, Associate Professor, ETC Engg, VSSUT Burla 14
Huffman coding
First stage
Image Compression
Second stage
1. Give the code 0 to the highest probability, and the code 1 to the lowest
probability
2. Go backwards through the tree one node at a time and repeat from (1)
until all gray levels have a unique code.
4/18/2025 Dr. Nilamani Bhoi, Associate Professor, ETC Engg, VSSUT Burla 15
Huffman coding
Example:
A 10×10, 2-bit image with gray levels and their occurrences are given in the
following table. Find the Huffman code.
Image Compression
Gray level 0 1 2 3
Freq. Of occurrences 20 45 30 5
Gray level 0 1 2 3
Huffman code 010 1 00 011
Lavg = 1×0.45+2×0.3+3×0.2+3×0.05
=0.45+0.6+0.6+0.15
=1.8
4/18/2025 Dr. Nilamani Bhoi, Associate Professor, ETC Engg, VSSUT Burla 16
Image Compression System
Image Compression
4/18/2025 Dr. Nilamani Bhoi, Associate Professor, ETC Engg, VSSUT Burla 17
Mapper
4/18/2025 Dr. Nilamani Bhoi, Associate Professor, ETC Engg, VSSUT Burla 18
DCT of normalized image
JPEG use DCT as mapper
Image Compression
Recovered Image
4/18/2025 Dr. Nilamani Bhoi, Associate Professor, ETC Engg, VSSUT Burla 20
Important and can
JPEG use DCT as mapper be used to recover
the image
Image Compression
Recovered Image
4/18/2025 Dr. Nilamani Bhoi, Associate Professor, ETC Engg, VSSUT Burla 21
JPEG Coding
Cr
Cb f(i, j) F(u, v)
Steps Involved:
Fq(u, v)
Y DCT Quantization 1. Discrete Cosine
Transform of each 8x8
8x8 8x8
pixel array
Image Compression
f(x,y) T F(u,v)
Quant… 2. Quantization using a
Tables table or using a constant
Coding 3. Zig-Zag scan to exploit
Tables Zig Zag redundancy
Scan 4. Differential Pulse Code
Header Modulation(DPCM) on
Tables the DC component and
DPCM Run length Coding of the
Data Entropy AC components
Coding 5. Entropy coding
RLC (Huffman) of the final
output
4/18/2025 Dr. Nilamani Bhoi, Associate Professor, ETC Engg, VSSUT Burla 22 22
Quantization Table
Luminance: QY =
Image Compression
p { 16 11 10 16 24 40 51 61
12 12 14 19 26 58 60 55
14 13 16 24 40 57 69 56
14 17 22 29 51 87 80 62
18 22 37 56 68 109 103 77
24 35 55 64 81 104 113 92
49 64 78 87 103 121 120 101
72 92 95 98 112 100 103 99}
4/18/2025 Dr. Nilamani Bhoi, Associate Professor, ETC Engg, VSSUT Burla 23
Quantization Table
Chrominance:
QC =
Image Compression
{ 17 18 24 47 99 99 99 99
18 21 26 66 99 99 99 99
24 26 56 99 99 99 99 99
47 66 99 99 99 99 99 99
99 99 99 99 99 99 99 99
99 99 99 99 99 99 99 99
99 99 99 99 99 99 99 99
99 99 99 99 99 99 99 99}
4/18/2025 Dr. Nilamani Bhoi, Associate Professor, ETC Engg, VSSUT Burla 24