Unit 4: Color Image Processing & Image Compression
Topic: Image Compression
1
Introduction: Image compression
❑ Image Compression: It is the Art & Science of
reducing the amount of data required to represent
an image.
❑ It is the most useful and commercially successful
technologies in the field of Digital Image
Processing.
❑ The number of images compressed and
decompressed daily is innumerable. 2
Image compression Continued…
❑ To understand the need for compact image representation, consider
the amount of data required to represent a 2 hour Standard
Definition (SD) using 720 x 480 x 24 bit pixel arrays.
❑ A video is a sequence of video frames where each frame is a full color
still image.
❑ Because video player must display the frames sequentially at rates near
30fps, SD video data must be accessed at
30fps x (720x480)ppf x 3bpp = 31,104,000 bps
fps – frames per second,
ppf – pixels per frame,
bpp – bytes per pixel & bps – bytes per second 3
Image compression Continued…
Thus a 2 hour movie consists of
31,104,000 bps x (602) sph x 2 hrs ≈ 2.24 x 1011 bytes.
OR
224GB of data
sph = second per hour
❑ Twenty seven 8.5GB dual layer DVDs are needed to store it.
❑ To put a 2hr movie on a single DVD, each frame must be
compressed by a factor of around 26.3.
❑ The compression must be even higher for HD, where image
resolution reach 1920 x 1080 x 24 bits/image.
4
Image compression Continued…
❑ Web page images & High-resolution digital camera photos also are
also compressed to save storage space & reduce transmission time.
❑ Residential Internet connection delivers data at speeds ranging from
56kbps (conventional phone line) to more than 12mbps (broadband).
❑ Time required to transmit a small 128 x 128 x 24 bit full color image
over this range of speed is from 7.0 to 0.03 sec.
❑ Compression can reduce the transmission time by a factor of around 2 to
10 or more.
❑ Similarly, number of uncompressed full color images that an 8 Megapixel
digital camera can store on a 1GB Memory card can be increased.
5
Data Compression & Redundancy
❑ Data Compression: It refers to the process of reducing
the amount of data required to represent a given quantity
of information.
❑ Data and Information are not the same thing; data are the
means by which information is conveyed.
❑ Because various amount of data can be used to represent the
same amount of information, representations that contain
irrelevant or repeated information are said to contain
redundant data.
6
Data vs Information
•The same information can be represented by different amount
of data – for example:
•Your wife, Helen, will meet you at Logan Airport in Boston
at 5 minutes past 6:00 pm tomorrow night
•Your wife will meet you at Logan Airport at 5 minutes past
6:00 pm tomorrow night
•Helen will meet you at Logan at 6:00 pm tomorrow night
7
Data Compression & Redundancy
❑ Let b & b’ denote the number of bits in two representations of the same
information, the relative data redundancy R of the representation with b
bits is
R = 1 – (1/C);
where, C commonly called the compression ratio, is defined
as
C = b / b’
❑ If C = 10 (or 10:1), for larger representation has 10 bits of data for every 1
bit of data in smaller representation.
8
So, R = 0.9, indicating that 90% of its data is redundant.
Type of Redundancy
❑ 2D intensity arrays suffers from 3 principal types of data
redundancies:
1) Coding redundancy: A code is a system of symbols used to represent a
body of information or sets of events.
❑ Each piece of event is assigned a code word (code symbol). The
number of symbols in each code word is its length.
❑ The 8-bit codes that are used to represent the intensities in most 2D
intensity arrays contain more bits than are needed to represent the
intensities.
9
Type of Redundancy Continued…
2) Spatial (interpixel) & Temporal redundancy:
❑ Because the pixels of most 2D intensity arrays are correlated spatially,
information is replicated unnecessarily.
❑ In video sequence, temporally correlated pixels also duplicate
information.
3) Irrelevant Information (Psychovisual redundancy):
❑ Most 2D intensity arrays contain information that is ignored by the
human visual system. It is redundant in the sense that it is not used.
10
Image Compression Models
• The image compression system is composed of 2 distinct functional
component: an encoder & a decoder.
• Encoder performs Compression while Decoder performs Decompression.
• Both operations can be performed in Software, as in case of Web browsers &
many commercial image editing programs.
• Or in a combination of hardware & firmware, as in DVD Players.
• A codec is a device which performs coding & decoding.
11
Image Compression Models Continued…
• Input image f(x,y) is fed into the encoder, which creates a compressed
representation of input.
• It is stored for future for later use or transmitted for storage and use at a
remote location.
• When the compressed image is given to decoder, a reconstructed
output image f’(x, y) is generated.
• In still image applications, the encoded input and decoder output are f(x, y) &
f’(x, y) resp.
• In video applications, they are f(x, y, t) & f’(x, y, t) where 't' is time.
• If both functions are equal then the system is called lossless, error free. If not
then it s referred to as lossy. 12
Image Compression Models Continued…
Symbol
Mapper Quantizer
coder
Symbol Inverse
Decoder Mapper
Image compression model
13
Image Compression Models Continued…
Encoding or Compression process:
Encoder is used to remove the redundancies through a series of 3
independent operations.
1. Mapper: It transforms f(x,y) into a format designed to reduce spatial
and temporal redundancies.
• It is reversible
• It may / may not reduce the amount of data to represent an image.
Ex. Run Length coding
• In video applications, mapper uses previous frames to remove
temporal redundancies.
14
Image Compression Models Continued…
Quantizer: It keeps irrelevant information out of compressed
representations.
• This operation is irreversible.
• It must be omitted when error free compression is desired.
• In video applications, bit rate of encoded output is often measured and used
to adjust the operation of the quantizer so that a predetermined average
output is maintained.
• The visual quality of the output can vary from frame to frame as a function
of image content.
15
Image Compression Models Continued…
Symbol Encoder: Generates a fixed or variable length code to represent the
quantizer output and maps the output in accordance with the code.
• Shortest code words are assigned to the most frequently occurring
quantizer output values. Thus minimizing coding redundancy.
• It is reversible.
• Upon its completion, the input image has been processed for the removal of
all 3 redundancies.
16
Classification of compression algorithms
Compression algorithm are classified in following two categories:
1. Lossless Compression.
2. Lossy Compression.
Lossless compression is useful in preserving information as there is no loss of
information. This type of algorithm is useful in legal and medical domains.
Lossy compression algorithm compress the data with certain amount of error
that is acceptable to the human observer. This type of algorithm is useful in
applications such as broadcasting, television and multimedia.
17
Difference b/w lossy and lossless compression algorithms
S.NO LOSSY COMPRESSION LOSSLESS COMPRESSION
While Lossless Compression does not eliminate
Lossy compression is the method which
1. eliminate the data which is not noticeable. the data which is not noticeable.
In Lossy compression, A file does not While in Lossless Compression, A file can be
2. restore or rebuilt in its original form. restored in its original form.
In Lossy compression, Data’s quality is But Lossless Compression does not compromise
3. compromised. the data’s quality.
4. Compression ratio is usually very high. Compression ratio is usually less.
Algorithms used in Lossy compression
are: Transform coding, Discrete Cosine Algorithms used in Lossless compression are: Run
Transform, Discrete Wavelet Transform, Length Encoding, Lempel-Ziv-Welch, Huffman
5. fractal compression etc. Coding, Arithmetic encoding etc.
18
Thank You
19