1
1
MADE BY :
AGENDA
What is Image
Compression?
Image compression reduces the amount of data needed to store or
transmit an image.
Step 3: Quantization 3
Each block is compressed through quantization.
4 Step 4: Storage
The compressed blocks are stored in a reduced amount
of space.
Step 5: Decompression 5
The image is reconstructed using the Inverse Discrete
Cosine Transform (IDCT).
The DCT Equation
is the x,yth element of the image is the size of the block that DCT done on is an entry of the transformed image
matrix p. from the pixel values of the original
(For the standard 8x8 block that
image matrix
JPEG compression uses, N equals
8 and x and y range from 0 to 7)
In Equation :
matrix M is first multiplied
on the left by the DCT
matrix T from the previous
section;
1-Quantization
The quality level is converted into a
Scaling Factor (S) using the
following formula:
For quality levels above 50:
S=(200-2*Q) / 100
For quality levels below 50:
S = (5000/Q)/ 100
Quantization is achieved by
dividing each element in the
transformed image matrix D by the
corresponding element in the
quantization matrix, and then
rounding to the nearest
integer value. For the following
step, quantization matrix Q50 is used
Quantization
Quantization reduces the precision of the DCT coefficients.
50 10
Quality Level Low Quality
Determines the amount of High compression, noticeable loss.
compression.
90
High Quality
Less compression, minimal loss.
Coding And Decompression
The decompressed image is reconstructed using the IDCT.
Coding
1
2 Decoding
Multiplication
3
IDCT
4
Rounding
5
6 Addition
2-Coding
The quantized matrix C is now ready for the final step of compression.
Before storage, all coefficients of C are converted by an encoder to a
stream of binary data (01101011...). In-depth coverage of the coding
process is beyond the scope of this article. However, we can point out
one key aspect that the reader is sure to appreciate. After quantization, it
is quite common for most of the coefficients to equal zero. JPEG takes
advantage of this by encoding quantized coefficients in the zig-zag
sequence shown in Figure 1. The advantage lies in the consolidation of
relatively large runs of zeros, which compress very well. The sequence in
Figure 1 (4x4) continues for the entire 8x8 block
3-Decompression
Reconstruction of our image beging by
decoding the bit stream representing
the
quantized matrix C. Each element of C
is then multiplied by the
corresponding element of the
quantization matrix originally used.
The IDCT is next applied to
matrix R, which is rounded to the
nearest integer. Finally, 128 is
added to each element of that
result, giving us the
decompressed JPEG version N of
our original 8x8 image block M.
Comparison of Matrices
Pepper Example
We can do the DCT and quantization process
on the peppers image
The image can now be decompressed using the inverse discrete cosine transform. At quality
level 50 there is almost no visible loss in this image, but there is high compression. At lower
quality levels, the quality goes down by a lot, but the compression does not increase very
much.