Professional Documents
Culture Documents
Topic: Jpeg Compression by DCT Techniques: Information Theory and Coding
Topic: Jpeg Compression by DCT Techniques: Information Theory and Coding
J COMPONENT
SUBMITTED BY:
ANIKET SARKAR-16BEC0402
CHAITENAYA GOEL-16BEC0580
SLOT: B1+TB1
VIT, Vellore
OBJECTIVE OF PROJECT
This project provides an overview of the DCT based JPEG lossy compression technique and
the steps involved in it. The steps of this algorithm will be explained briefly throughout the
project and the steps will be implemented in MATLAB.
The remarkable quality of JPEG is that it achieves high compression ratios with little loss in
quality. The aim of this project is to compress the size of jpeg image without much loss
in quality. JPEG format is quite popular and is used in a number of devices such as digital
cameras and is also the format of choice when exchanging large sized images in a bandwidth
constrained environment such as the Internet.
JPEG can’t be used for images with sharp edges, lines as it causes a Ringing effect on the
edges. It is best on photographs and paintings of realistic scenes with smooth variations of
tone and colour. JPEG is also not well suited to files that will undergo multiple edits, as
some image quality will usually be lost each time the image is decompressed and
recompressed.
BLOCK DIAGRAM
JPEG compression will be implemented using MATLAB. The following methods will be
used for the same:-
Using the above methods, we can perform JPEG compression using MATLAB.
Need for Compression Technique
Ø An image, 1024 pixel x 1024 pixel x 24 bit, without compression, would require 3 MB
of storage and 7 minutes for transmission, utilizing a high speed, 64 Kbit/s, ISDN line.
If the image is compressed at a 10:1 compression ratio, the storage requirement is
reduced to 300 KB and the transmission time drops to under 6 seconds.
Ø So compression requirement can be explained from both Engineer point of view &
Layman point of view. As an Engineer point of view large image files require more
bandwidth thus high cost is an issue. As a layman point of view device storage
problem can occur due to large image files.
Now the image should be converted from RGB into a different color
space called YCbCr. It has three components Y, Cb and Cr: the Y
component represents the brightness of a pixel, the Cb and Cr
components represent the chrominance (split into blue and red
components).
Pixels of an image
• Luminance: received brightness of the light, which is proportional to the total energy in
the visible band.
• Chrominance: the perceived color tone of a light, which depends on the wavelength
composition of light chrominance is in turn characterized by two attributes – hue and
saturation.
1. Hue: Specify the color tone, which depends on the peak wavelength of the light
2. Saturation: Describe how pure the color is, which depends on the spread or
bandwidth of the light spectrum. Y is the brightness (luma), Cb is blue minus luma (B-Y)
and Cr is red minus luma (R-Y).
2) DOWN SAMPLING :The transformation into the YCbCr color model enables the next
step, which is to reduce the spatial resolution of the Cb and Cr components (called "down
sampling" or "chroma subsampling"). The ratios at which the down sampling can be done on
JPEG are 4:4:4 (no down sampling),4:2:2 (reduce by factor of 2 in horizontal direction), and
most commonly4:2:0 (reduce by factor of 2 in horizontal and vertical directions).
3) BLOCK SPLITTING:
After subsampling, each channel must be split into 8 ×8 blocks of pixels. Depending on
chroma subsampling, this yields (Minimum Coded Unit) MCU blocks of size 8 ×8 (4:4:4 –
no subsampling), 16 ×8 (4:2:2), or most commonly 16 ×16 (4:2:0).
5) Coefficient matrix: Blocks above are that of low frequency (high energy) and those below
are the ones with high frequency (low energy) which will be further removed.
Low frequency signalà slowly varying signal.
High frequency signalà includes a sharp edge.
Basic Steps :
♦ Split image into 8 cross 8 pixel
♦ Represent each pixel by diff. cosine signals.
♦ Remove the high frequency components(compression).
Each component (Y, Cb, Cr) of each 8×8 block is converted to a frequency-domain
representation, using a normalized, two-dimensional type-II discrete cosine transform (DCT).
Before computing the DCT of the subimage, its gray values are shifted from a positive range
to one centered around zero. For an 8-bit image each pixel has 256 possible values: [0,255].
To center around zero it is necessary to subtract by half the number of possible values, or
128.
Step2: Subtracting 128 from each pixel value yields pixel values on [ − 128,127].
Step3: The next step is to take the two-dimensional DCT, which is given by:
Note the rather large value of the top-left corner. This is the DC coefficient. The remaining
63 coefficients are called the AC coefficients.
Step 5 : We get the following matrix by dividing corresponding Coefficient matrix values
and Quantization matrix values.
For example, using −415 (the DC coefficient) and rounding to the nearest integer,
This process helps us to remove high frequency components from the right downward side
of the matrix. This therefore compresses the image with loss in its space but not much
noticeable changes in the image.
. 2) Initialize the rows and columns of the matrix and other variables used in the forming
the matrix
. 8) Then start the Quantization process by subtracting 128 from each element of the matrix
. 9) Using the Quantization table matrix round of the each value and display the matrix
11) In inverse DCT each element should be added 128 value to each element of the matrix
♦ We focused on the Fast and efficient lossy coding algorithms JPEG for image
Compression/Decompression using Discrete Cosine transform. We also briefly
introduced the principles behind the Digital Image compression and various
image compression methodologies and the jpeg process steps including DCT,
quantization , entropy encoding.
REFERENCES :
• Mathworks.com
• A.M.Raid , W.M.Khedr , M. A. El-dosuky and Wesam Ahmed “Jpeg Image Compression Using
Discrete Cosine Transform - A Survey” International Journal of Computer Science & Engineering
Survey (IJCSES) Vol.5, No.2, April 2014.
• Andrew B. Watson, NASA Ames Research Center “Image Compression Using the Discrete Cosine
Transform”.