You are on page 1of 8

Multimedia Computing (SWE419)

JPEG Compression
Submitted by
Siva Rushi.B

10mse1063

Professor
Dr. Asha.S

School of Computer Science & Engineering (SCSE)


VIT UNIVERSITY - CHENNAI

INTRODUCTION:

JPEG Compression is the name given to an algorithm developed by the Joint Photographic
Experts Group whose purpose is to minimize the file size of photographic image files.
JPEG applies to color and gray-scaled still images.
JPEG compression is a powerful tool, and with great power comes great responsibility.
While JPEG compression can help you greatly reduce the size of an image file, it can also
compromise the quality of an image - and if you arent careful, there may not be any recovery.
JPEG REQUIREMENTS

Independence from image size.


Applicability to any image aspect ratio and any pixel aspect ratio.
Independence of the color space and the number of colors used.
Unlimited complexity of image content.
Currency regarding the compression factor and image quality.
Platform independence of software solutions and major complexity reductions for h/w
solutions.
Support for sequential and progressive decoding.
Support for lossless hierarchical coding with different resolutions.

There are four main steps in the JPEG compression process:

JPEG: IMAGE PREPARATION

JPEG specifies a general image model that can describe most commonly used still image
representations
The mapping between coded color values and the colors they represent is not coded.
Which requirements the above two properties satisfy?
An image consists of at least one and at most N = 255 components or planes.

Components may be assigned to three colors in RGB, YIQ or YUV signals.


RGB color space model
Most computer display and input devices use the RGB color space model where red,
green and blue pixels are represented by a number of bits per component.
Luma/Croma Representation
Luma or luminance (Y) is the perceived intensity of the image and is calculate by
Y = 0.299R + 0.587G + 0.114B
Chroma or chrominance is the perceived color of image and it can be processed to
define a YUV model as
V = (R-Y)/1.14 = 0.877 (R-Y)
U = (B-Y)/2.03 = 0.493 (B-Y)
Every picture is represented as a luminance component and two chrominance
components

JPEG MODES

JPEG defines four modes


Lossy sequential DCT-based mode
Must be supported by every JPEG decoder.
Expanded lossy DCT-based mode
Provides a set of enhancements for the base mode.
Lossless mode
Low compression ratio and perfect reconstruction of images.
Hierarchical mode
Accommodates images of different resolutions by using algorithms defined for
the other three modes.
LOSSY SEQUENTIAL DCT-BASED MODE:

Image Processing

After image preparation, the uncompressed image samples are grouped into data
units of 8 8 pixels.
The order is defined by the MCUs
Each sample is encoded using p=8bit.
Each pixel is an integer between 0 and 255
Image processing is carried out as follows
DCT-based transformation coding is carried out.
Pixel values are shifted into (-128, 127) interval.
A forward DCT (FDCT) is applied to each transformed pixel value.
For later reconstruction, the decoder uses the IDCT.
Note that if the FDCT and IDCT computations were exact, it wouldbe possible to
reproduce the original 64 pixel values exactly. In practice, precision is limited,
and therefore, the technique is lossy.
4

JPEG does not specify a standard precision. Therefore, two different decoders may
yield different images as output of the same compressed data.
Quantization

Image processing is followed by the quantization of all DCT coefficients

Lossy process.
Specific frequencies can be given more importance than others.
Tables are used for the quantization and dequantization.
Must use the same tables for both processes.
Image quality may decrease due to quantization.
For this step, the JPEG application provides a table with 64 entries, one for each of the 64 DCT
coefficients. This allows each of the 64 coefficients to be adjusted separately. The application
can thus influence the relative significance of the different coefficients. Specific frequencies
can be given more importance than others depending on the characteristics of the image
material to be compressed. The possible compression is influenced at the expense of
achievable image quality

Entropy Encoding

Quantization is followed by Entropy Encoding, the quantized DC-coefficients are treated


differently than the quantized AC-coefficients. The processing order of all coefficients is
specified by the zig-zag sequence.
The DC-coefficients determine the fundamental color of the data units. Since this changes
little between neighboring data units, the differences between successive DC-coefficients are
very small values. Thus each DC-coefficient is encoded by subtracting the DC-coefficient of
the previous data unit, as shown in Figure, and subsequently using only the difference.

The DCT processing order of the AC-coefficients using the zig-zag sequence as shown in Figure
illustrates that coefficients with lower frequencies (typically with higher values) are encoded
first, followed by the higher frequencies (typically zero or almost zero). The result is an
extended sequence of similar data bytes, permitting efficient entropy encoding.

EXPANDED LOSSY DCT-BASED MODE:

Image preparation in this mode differs from the previously described mode in terms of the
number of bits per pixel. This mode supports 12 bits per sample value in addition to 8 bits. The
image processing is DCT-based and is performed analogously to the baseline DCT mode. For
the expanded lossy DCT-based mode, JPEG defines progressive coding in addition to
sequential coding. In the first decoding run, a very rough, unsharp image appears. This is
refined during successive runs
Progressive image presentation is achieved by expanding quantization. This is equivalent to
layered coding. For this expansion, a buffer is added at the output of the quantizer that
temporarily stores all coefficients of the quantized DCT. Progressiveness is achieved in two
different ways:
Using spectral selection, in the first run only the quantized DCT-coefficients of each
data units low frequencies are passed on to the entropy encoding. Successive runs
gradually process the coefficients of higher frequencies.
In successive approximation, all of the quantized coefficients are transferred in each
run, but individual bits are differentiated according to their significance. The most
significant bits are encoded before the least significant bits.

LOSSLESS MODE:

The lossless mode uses single pixels as data units during image preparation. Between 2 and 16
bits can be used per pixel. Although all pixels of an image must use the same precision, one
can also conceive of adaptive pixel precision.

In this mode, image processing and quantization use a predictive technique instead of
transformation coding. For each pixel X as shown in Figure, one of eight possible predictors is
selected. The selection criterion is the best possible prediction of the value of X from the
already known adjacent samples A, B, and C.
The number of the chosen predictor, as well as the difference between the prediction and the
actual value, are passed to the subsequent entropy encoding, which can use either Huffman or
arithmetic coding.
HIERARCHICAL MODE

The hierarchical mode can either use one of the lossy DCT-based algorithms described above
or alternatively use the lossless compression technique, as the need arises. The main feature of
this mode is the encoding of an image at different resolutions, that is, the compressed image
contains images at several resolutions. To do this, the prepared digital image is first reduced
by a factor of 2n and compressed.
The original image is then reduced by a factor of 2n-1 vertically and horizontally. The previously
compressed image is subtracted from this, and the result is once again compressed. This
process is successively repeated until the full resolution of the image is compressed.
Hierarchical coding is computationally intensive and requires considerable storage space. The
advantage is the compressed image is available at different resolutions. Applications working
with lower resolutions thus do not need to first decode the whole image and then reduce the
resolution. In other words, scaling becomes cheap. Yet, in the case of images encoded
according to the hierarchical JPEG mode, the display of a reduced size picture requires less
time to process than one of higher resolution.
---------------------------------------- THANK YOU MAM --------------------------------------

You might also like