You are on page 1of 38

Introduction to Image Compression

JPEG standard

Block diagram and Main Steps

Transform RGB to YIQ or YUV


DCT on image blocks
Quantization
Preparation for entropy coding

Modes of operation in JPEG

Different JPEG standards


INTRODUCTION TO IMAGE COMPRESSION

application of Data Compression on Digital Images

the objective is to reduce redundancy of the image data

Image compression can be

lossy loseless
•Suitable for natural For artificial images such as
images technical drawings, icons or
•Minor loss of comics, line drawings etc
fidelity

Where a higher compression ratio is required, lossy


methods are usually adopted.
The compressed image is usually not same as the
original image but is meant to form a close
approximation to the original image perceptually.

Original Reconstructed
JPEG STANDARD
JPEG stands for Joint Photographic Experts Group

It’s a compression standard for still color and gray-


scale images, also known as ‘continuous tone image

The JPEG standard specifies both the codec

JPEG compression are called “JPEG files”

The most common filename extensions are .jpg and


.jpeg (.jpe, .jfif and .jif are also used)
•Wavelet based JPEG 2000
•Lossless JPEG-LS
•Bi-level image compression JBIG, JBIG2
Original (979 KB) JPEG (6.21 KB)
To YIQ or YUV
f (u,v)
f (i,j)
DCT
Quantization

8X8

Quantization

Coding Tables
Tables

Header
Tables
Entropy
Data DC Zigzag
Coding DPCM

RLC
AC
YUV and Y'UV  a specific analog encoding of color information

YCbCr  digital encoding of color information suited for video


and still-image compression and transmission such as MPEG and
JPEG

Y' = luma component (the brightness)


U and V are the chrominance (color) components.

Y'= 0.299R' + 0.587 G' + 0.114 B'


U= B'-Y'
V=R'-Y'
For Gray  R'=G'=B' Y'= Gray value of R'
as sum of coefficients is one, U and V are zero.

YIQ is a version of YUV with same Y' but with U and


V rotated by 33 degree.
Color
transform
Perform DCT on Image
Blocks

DCT is a mathematical operation

Allows us to represent the signal with only a


few data points in a frequency domain that would
take lots of data points if represented in a time
domain

Technique is on both color & Gray-scale image

When consider over 8X8 matrix of 64 values,


each with x and y coordinates, we have a 3D
representation or spatial domain.
Perform DCT on Image
Blocks

Benefits:
DCT is proven to be the optimal transform
DCT is an orthogonal transform
Good compression of the block
Can be computed efficiently
DCT algorithm is symmetrical
Input matrix of DCT coefficients:

132 136 138 140 144 145 147 155

136 140 140 147 140 148 155 156

140 143 144 148 150 152 154 155

144 144 146 145 149 150 153 160

150 152 155 156 150 145 144 140

144 145 146 148 143 158 150 140

150 156 157 156 140 146 156 145

148 145 146 148 156 160 140 145


Output matrix of DCT coefficients:

172 -18 15 -8 23 -9 -14 19

21 -34 24 -8 -10 11 14 7
DC

-9 -8 -4 6 -5 4 3 -1

-10 6 -5 4 -4 4 2 1

-8 -2 -3 5 -3 3 4 6

4 -2 -4 6 -4 4 2 -1

4 -3 -4 5 6 3 1 1

0 -8 -4 3 2 1 4 0
DCT transform
Quantization
Heart of any lossy scheme

It is a process that attempts to determine what


information can be safely discarded without a
significant loss in visual fidelity

The DCT output matrix is quantized to reduce the


precision of the coefficient.

JPEG algorithm includes a set of quantization tables,


derived from extensive empirical experimentation

Quantized coefficient (i, j) = DCT (i, j)  DCT coefficients


Quantum (i, j)  Quantized matrix
Quantum matrix Table:

4 7 10 13 16 19 22 25
7 10 13 16 19 22 25 28
10 13 16 19 22 25 28 31
13 16 19 22 25 28 31 34
16 19 22 25 28 31 34 37
19 22 25 28 31 34 37 40
22 25 28 31 34 37 40 43
25 28 31 34 37 40 43 46

Typiclly a JPEG quantum matrix has larger values in the lower half
of the quantum matrix
DCT coefficients after quantization :.

43 3 2 0 0 0 0 0
3 3 2 0 0 0 0 0
1 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0

Here the significant values are concentrated to the left and top of the
matrix. After quantization most quantized DCT coefficients in 8X8
matrix are truncated to zero values
Preparation for Entropy Coding:
•Run Length Encoding on ACs
•DPCM on DCs

Zigzag Sequence :
This pattern is designed RUN Length Coding on
to facilitate entropy AC coefficients
coding by placing low
frequency coefficients Differential Pulse Code
Modulation on DC
Coefficient

Huffman Coding

Entropy coding
Modes of Operation in JPEG

• sequential encoding
•Lossless encoding

• Progressive encoding
•Hierarchical
encoding

Sequential Encoding:
Uses Huffman coding.
Each block is encoded in a single left-to-right and
top-to-bottom scan.

Progressive Encoding:
Each scan follows the zigzag ordering, quantization and
entropy coding, same as sequential encoding, but takes much
less time to encode and decode.

Two forms of progressive encoding:


(a) spectral selection approach
(b) successive approximation approach
Lossless encoding :-:
Theoretically, it should have been possible to achieve

lossless encoding by eliminating the quantization block

Hierarchical encoding :-

•pyramidal encoding

•Finest resolution lowermost


layer

•Reduced Resolution Successive


upper layers
Start of image Frame End of image

Tables, etc Header Scan ……… Scan

Tables etc Header Segment Restart Segment Restart ………

Block Block Block ………..


The JPEG2000 Standard :- Wavelet based
.jp2 file extension

Addresses the problems like…


•Low bit-rate compression

•Lossless and lossy compression

•Large images

•Single decompression architecture

•Transmission in noisy environments

•Computer generated imaginary

•Compound documents
Comparison of JPEG and JPEG2000 Performance

Original Image JPEG JPEG2000

Compressed images at 1bpp


Compressed images at 0.25 bpp by means of (a) JPEG and (b) JPEG2000
After color transformation, the image is split into tiles

These tiles are then wavelet transformed to an arbitrary depth

reversible irreversible

The quantized sub-bands are split further into precincts

Precincts are split further into code blocks

EBCOT stands for Embedded Block Coding with Optimal


Truncation
Propagation, Magnitude Refinement, Cleanup pass

binary arithmetic coder The result is a bit-stream that is split


into packets

Packets from all sub-bands are then collected in so-called layers


Applications
BILEVEL IMAGE
JPEG-LS COMPRESSION
a simple and efficient
baseline algorithm which
consists of two
independent and distinct
stages called
modeling and encoding

"near-lossless" image
Multi-Level Bi-Level
compression standard (Gray Scale) (Black & White)
that could offer better
compression efficiency •High Frequency
than lossless JPEG •Very High Resolutions
Will often contain text,
halftone images
and line-art
Conclusion

what we have achieved in this methodology is the


reduction of large volume of data to a smaller version
of what is really significant

The JPEG standard is designed to provide common


methodology for compression of continuous tone of
images.

Hence the need to efficiently process and store


images in digital form has been fulfilled by image
compression standard- JPEG
Bibliography

Fundamentals of Multimedia by Ze-Nian Li and Mark S Drew


Multimedia Communication by Ze-Nian Li and Mark S Drew
Multimedia Engineering-Wiley Publications
Multimedia Communication by Gibson
Multimedia Technologies for application –IEEE Press

Wikipedia and related websites as internet reference for images.

http://en.wikipedia.org/wiki/JPEG
http://en.wikipedia.org/wiki/JPEG_2000
http://cobweb.ecn.purdue.edu/~ace/jpeg-tut/jpegtut1.html
Bye------Thank You 

Compressed Images at 0.125 bpp by means of (a) JPEG and (b) JPEG2000

You might also like