0% found this document useful (0 votes)
12 views

1

Uploaded by

rybkarate18
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

1

Uploaded by

rybkarate18
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 17

Image Compression

MADE BY :
AGENDA
What is Image
Compression?
Image compression reduces the amount of data needed to store or
transmit an image.

Eliminate Optimize Storage


Redundancy
Saves space and bandwidth.
Removes unnecessary
information.
LOSSY
AND
LOSSLESS
The History of DCT
Nasir Ahmed (born 1940) is an Indian-American electrical engineer and
computer scientist. He is Professor Emeritus of Electrical and Computer
Engineering at University of New Mexico (UNM). He is best known for
inventing the discrete cosine transform (DCT) in the early 1970s. The DCT is
the most widely used data compression transformation, He also described the
discrete sine transform (DST), which is related to the DCT

1 DCT's Impact 2 Widely Used


The DCT is the foundation It's used in image, video,
for most digital media and audio compression.
standards.
The JPEG Compression Process

Step 1: Block Division 1


The image is divided into 8x8 blocks of pixels.

2 Step 2: DCT Application


The DCT is applied to each block.

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

p(x, y) (N) D(і, ј)

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)

Therefore D(i, j ) would be as in Equation (3).


The DCT Matrix
To get the matrix form of Equation (1), we will use the following equation

The columns of T form an orthonormal set, so T is an


2 orthogonal matrix. Which the inverse of T is T‘ which
is easy to calculate
Doing the DCT on an 8x8 Block

the pixel values of a black-and-white image range from 0 to 255 in steps


of 1

pure black pure white


1 2
is represented by 0 by 255

This block of image-pixel


values. This particular block
was chosen from the very
upper- left-hand corner of an
image.

DCT is designed to work


on pixel values ranging
from -128 to 127, the
original block is ”leveled
off” by subtracting 128
from each entry. This
results is:
the Discrete Cosine Transform

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 matrix is then rounded and


clipped to have positive integer values
ranging from 1 to 255, For example, the
following quantization matrices yield
quality levels of 10 and 90

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.

Figure 1 – Original Peppers Figure 2– Quality 50 – 84% Z

You might also like