0% found this document useful (0 votes)
69 views30 pages

MMC Unit 4

This document discusses image compression techniques. It describes how images can be computer-generated or digitized. For digitized images, lossless compression is used for documents while lossy compression is used for pictures. Formats like GIF, TIFF, and JPEG are described. JPEG is explained in detail through its 5 main stages: image preparation, discrete cosine transform, quantization, entropy encoding, and frame building.

Uploaded by

nandini p
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)
69 views30 pages

MMC Unit 4

This document discusses image compression techniques. It describes how images can be computer-generated or digitized. For digitized images, lossless compression is used for documents while lossy compression is used for pictures. Formats like GIF, TIFF, and JPEG are described. JPEG is explained in detail through its 5 main stages: image preparation, discrete cosine transform, quantization, entropy encoding, and frame building.

Uploaded by

nandini p
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/ 30

UNIT -4

Image Compression
Contents
1.1Introduction
1.2Graphics interchange format
1.3Tagged image file format
1.4Digitized documents
1.5Digitized pictures
1.6JPEG
Introduction
Images can be of two basic types:
1. Computer-generated (also known as graphical) images and
2. Digitized images (of both documents and pictures).
To transfer digitized images two types of compression
algorithm normally are employed:
1. A combination of run-length and statistical encoding. It is
lossless and is used for the transfer of the digitized
documents generated by scanners such as those used in
facsimile machines.
2. A combination of transform, differential, and run-length
encoding and has been developed for the compression of
both bitonal and color digitized pictures.
Graphics interchange format (GIF):
The graphics interchange format (CIF) is used extensively with the
Internet for the representation and compression of graphical images.
Color images comprising 24-bit pixels are supported 8 bits each for
R. G, and B
 The resulting table of colors therefore consists of 256 entries, each
of which contains a 24-bit color value.
Thus instead of sending each pixel as a 24-bit value, only the 8-bit
index to the table entry that contains the closest match color to the
original is sent. This results in a compression ratio-of 3:1.
The table of colors can relate either to:
1. Whole image — in which case it is referred to as the global color
table
2. To a portion of the image, when it is referred to as a local color
table.
Tagged image file format

 It supports pixel resolutions of up to 48 bits —16


bits each for R, G, and B.
 Is intended for the transfer of both images and
digitized documents.
 The image data can be stored and hence transferred
over the network in a number of different formats.
 The particular format being used is indicated by a
code number and these range from the
uncompressed format (code number 1) through to
LZW-compressed which is code number 0Code
numbers 2, 3, and 4 are intended for use with
digitized documents.
Digitized documents
Digitized pictures

To reduce the time to transmit digitized


pictures compression is applied to the
two- dimensional array
Most widely adopted standard is JPEG
which describes the compression of
digitized pictures.
JPEG
JPEG is an acronomy for Joint Photographic
Expert Group.
It is the widely adapted standards relating to the
compression of digitized pictures.
 There are 5 main stages they are:

1. Image/block preparation
2. Forward DCT
3. Quantization
4. Entropy Encoding
5. Frame Building
1.6.1Image/block preparation:

The source image is made of one or more 2-D matrices


of values.
 For continuous tone monochrome image, a single 2-D
matrix is required to store the set of 8-bit grey level
values that represent the images.
For color image, if a CLUT is used just a single matrix
of values is required.
If the image is represented in an R, G, B format three
matrices are required, one each for the R, G, and B
quantized values.
 For color images the alternative form of representation
known as Y, Cb, Cr can optionally be used..
1.6.2 Forward DCT:
Transforms the pixel information from spatial
domain to frequency domain with the DCT.
 Each pixel value is quantized using 8 bits
which produces a value in the range 0 to 255
for the intensity values — R, G, B or Y.
 The value in the range —128 to +127 for the
two chrominance values— Cb and Cr.
To compute DCT, however, all the values are
centered around zero by subtracting 128 from
each intensity values.
1.6.3 Quantization:
JPEG standard includes two default
quantization table values:
1. One for use with the luminance
coefficients and
2. The other for use with the two sets of
chrominance coefficients.
Number of points can be concluded from the values
shown in the tables:
1. The computation of the quantized coefficients involves
rounding the quotients to the nearest integer value.
2. The threshold values used, in general, increase in
magnitude with increasing spatial frequency.
3. The DC coefficient in the transformed matrix is
largest.
4. Many of the higher-frequency coefficients are zero.
 It is the last two points that are exploited during the
encoding stage.
1.6.4 Entropy encoding:
 It has 4 stages:
1. Vectoring
2. Differential encoding
3. Run-length encoding
4. Huffman encoding.
Vectoring:
Since the output of the quantization stage
is a 2-D matrix of values, in order to
apply any entropy encoding to the set of
values in the matrix, we must first
represent the values in the form of a 1-D
vector and this operation is known as
vectoring.
 Differential encoding: In this stage only the difference in
magnitude of the DC coefficient in a quantized block
relatively to the value in the preceding block is encoded.
 In this way number of bits required to encode DC
coefficient is reduced significantly.
 Ex: if the sequence of DC coefficients in consecutive
quantized blocks-one per block- were 12,13,11,11,10,…..
 Corresponding difference amount will be, 12, 1,-2, 0,-1…
 The difference values are then encoded in the form
(SSS,value)
 Where, SSS = number of bits needed to encode the value.
Value = actual bits that represent the value.
Run-length encoding:
The remaining 63 values in the vector are the
AC coefficients and, because of the zig-zag
scan, the vector contains long strings of zeros
within it.
 To exploit this feature, the AC coefficients
are encoded in the form of a string of pairs of
values. Each pair is made up of (skip, value)
where skip = number of zeros in the run and
value = next non-zero coefficient.
Huffman encoding :
Huffman coding is used to encode the output of
both the differential and run-length encoders.
 For the differential-encoded DC coefficients in the
block, the bits in the SSS field are not sent in their
unsigned binary form but are sent in a Huffman-
encoded form.
This is done so that the bits in the SSS field have
the prefix property and this enables the decoder to
determine unambiguously the first SSS field from
the received encoded bitstream.
1.6.5 Frame building:
In order for the decoder in the remote
computer to be able to interpret all the
different fields and tables that make up the
bitstream, it is necessary to delimit each
field and set of table values in a defined
way. The JPEG standard, therefore, includes
a definition of the structure of the total
bitstream relating to a particular
image/picture. This is known as a frame and
its outline structure
JPEG decoding:
JPEG decoder is made up of a number of
stages which are simply the corresponding
decoder sections of those used in the
encoder.
 The time to carry out the decoding
function is similar to that used to perform
the encoding.

You might also like