JPEG
JPEG
JPEG
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
04 05 06
Y-64/64 - 100%
Cb-16/64- 25%
Cr-16/64- 25%
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)
/ =
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)
JPEG SPECIFIC RLE:{[(0, 7), 90], [(0, 6), -40], [(1, 3), 5], [(2, 3), 4], [(3, 4), 11], [(8, 2), -3], [(0, 0)]}
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.
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