0% found this document useful (0 votes)
13 views19 pages

JPEG

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1/ 19

JPEG (Joint Photographic Expert Group)

IMAGE COMPREESSION TECHNIQUE


Image Compression and it’s Types
Objective of Image Compression is to reduce irrelevant and redundant image data in order to be ale to
store or transmit data in efficient form

Lossless image compression is a compression algorithm that allows the original image to be perfectly
reconstructed from the compressed data (PNG-where redundancy reduction plays a major role)

Lossy image compression is a type of compression where a certain amount of information is discarded,
which means that some data are lost and hence the image cannot be perfectly reconstructed from the
compressed data

JPEG comes under lossy compression, it deliberately losses information so that storage space reduction is
more than 75 percent
What sort of Info JPEG gets rid off?

Our eyes are more sensitive to brightness and also our eyes are less sensitive to high
frequency components
JPEG PROCESS
ALGORITHM
01 02 03

Splitting RGB to YCbCr DCT


8x8 non overlapping pixels Colour treatment Frequency transformation
(zero padding)

04 05 06

Quantization Lossless encoding Compressed Format


Based on quantization tables For further reduction File format with reduced size
and JPEG standards
RGB to YCbCr
Chroma Subsampling (4:2) or
Chroma Downsampling (4:2)

Y-64/64 - 100%

Cb-16/64- 25%
Cr-16/64- 25%

50% reduction is achieved


FORWARD DCT
The DCT uses the cosine function, therefore not interacting with complex numbers at all.
DCT converts the information contained in a block(8x8) of pixels from spatial domain to the
frequency domain.

Why DCT?

Human vision is insensitive to high frequency components, due to which it is possible to treat
the data corresponding to high frequencies as redundant. To segregate the raw image data
on the basis of frequency, it needs to be converted into frequency domain, which is the
primary function of DCT.
But the image matrix is a 2-D matrix. So we can either apply 1-D DCT to the image matrix
twice. Once row-wise, then column wise, to get the DCT coefficients. Or we can apply the
standard 2-D DCT formula for JPEG compression. If the input matrix is P(x,y) and the
transformed matrix is F(u,v) or G(u,v) then the DCT for the 8 x 8 block is computed using the
expression
Considering Y pixels
ENERGY COMPACTION
(a property of DCT)

Most of the largest values


are concentrated in a few
low frequency coefficients
QUANTIZATION
Removing high frequency components after the frequency separation done by DCT

STANDARD FORMULA: round ()

F(u, v) represents a DCT coefficient


Q(u, v) is a “quantization matrix”

What is Quantisation matrix?

Provided by JPEG standard from visual experiments. Basically a quality factor of 50 is


used ,increasing quality factor reduces the qunatisation table values. There is a separate
table for Luma and Chrominance channel
LUMINANCE CHANNEL CHROMINANCE CHANNEL
DCT table Quantisation table Quantized table

/ =

Encoding with these matrix tend to eliminate the lower corner part to zero (eliminating higher
frequency),while decoding with the same matrix only upper part can be recovered, hence it is a
lossy compression
RUN LENGTH ENCODING(ZIG ZAG SCAN)

{90, -40, 0, 5, 0[x2], 4, 0[x3], 11, 0[x8], -3, 0[x44]}

JPEG SPECIFIC RLE:{[(0, 7), 90], [(0, 6), -40], [(1, 3), 5], [(2, 3), 4], [(3, 4), 11], [(8, 2), -3], [(0, 0)]}

Basically to reduce storage space occupied by redundant bits


DPCM ON DC COEFFICIENTS
The DC coefficients are coded separately from the AC ones. Differential Pulse
Code Modulation (DPCM) is the coding method.

If the DC coefficients for the first 5 image blocks are 150, 155, 149, 152, 144, then
the DPCM would produce 150, 5, -6, 3, -8, assuming di = DCi+1 − DCi, and d0 =
DC0.

HUFFMAN CODING ON DC AND AC COMPONENTS


The DC and AC coefficients finally undergo an entropy coding step to gain a possible
further compression. Each DPCM coded DC coefficient or RLE AC coefficient is
represented by (SIZE, AMPLITUDE), where SIZE indicates how many bits are needed
for representing the coefficient, and AMPLITUDE contains the actual bits.
150, 5, −6, 3, −8 will be turned into (8, 10010110), (3, 101), (3, 001), (2, 11), (4, 0111)
SIZE is Huffman coded since smaller SIZES occur much more often.
MERITS
• High Compression Ratio-Nearly 75% reduction in storgae
• Color Support-Most of the compression doesn’t support color files
• Variable Comression Levels-Based on quantisation tables,desired compression level can be
achieved
• Widespread Compatibilty-platform independent file

DEMERITS
• Lossy Compression Artifacts- blockiness, blurriness, and color bleeding, especially at higher
compression levels
• Not Suitable for Text and Line Art: JPEG compression is optimized for photographic images
and is not well-suited for images with sharp edges, text, or line artVariable

You might also like