1903412HW

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

How Does JPEG Compression Work?

JPEG (short for Joint Photographic Experts Group) is most known and common method of
compression used in digital photography. It’s a lossy compression, so during the process even
though the size of the file is reduced without damaging the quality some information the human eye
might not notice is lost. Therefore the image before and after compression are not exactly the same.

During the first step of JPEG compression, which is the step where RGB color format is converted to
the Y (representing the luminance), Cb (representing color blueness) and Cr (color redness) which
are chromium colors that the human eye is less sensitive to therefore when removed would be
harder to detect. This step only changes the representation of the same information but since the
human eye is not sensitive the color information it can be downsampled while still avoiding serious
visible image information.

After that the image is divided into 8x8 blocks, forming 64 blocks and each block is called 1 pixel. To
these pixels we apply DCT (short for Discrete Cosines Transformation). With DCT, the image content
which was represented by a list of pixel number and pixel value is now described by the coefficient
of the spatial frequencies for vertical and horizontal orientation. Performing quantization by using
quantum tables, the amount of data needed to store 64 coefficients is reduced. The amount of
information that is lost depends on the steps of quantization and the user can determine the
intensity of compression.

The data compression is done by applying different encoding methods. Performing zig-zag scanning
pattern the data is reordered using run-length encoding according to their spatial frequencies so the
similar frequencies are together, first the lower frequencies and last are the higher ones. Then
length coding zeros are inserted and lastly Huffman encoding is applied. This way the coefficients
that were reduced to zero by quantization that were in higher frequencies are in lower. Now these
zeros that are at the bottom after some other values can be stored more efficiently therefore a
considerable amount of data is reduced.

Resources:

- https://www.geeksforgeeks.org/process-of-jpeg-data-compression/
- https://www.image-engineering.de/library/technotes/745-how-does-the-jpeg-compression-
work#:~:text=The%20JPEG%20compression%20is%20a,setting%20(or%20chose%20presets).
- https://en.wikipedia.org/wiki/JPEG#Quantization
- https://www.quora.com/How-does-JPEG-compression-technically-work

Elin Su Şentürk
1903412

You might also like