0% found this document useful (0 votes)
53 views11 pages

DIP Image Compression (Chapter-06)

Chapter 6 discusses image compression, defining it as the reduction of image file size without significantly degrading quality. It contrasts lossy and lossless compression methods, explains data redundancy, and outlines various applications and techniques, including JPEG compression. The chapter also covers the principles of channel encoding and decoding in the context of image compression systems.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views11 pages

DIP Image Compression (Chapter-06)

Chapter 6 discusses image compression, defining it as the reduction of image file size without significantly degrading quality. It contrasts lossy and lossless compression methods, explains data redundancy, and outlines various applications and techniques, including JPEG compression. The chapter also covers the principles of channel encoding and decoding in the context of image compression systems.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Chapter 6

Image compression

No Question Year
1 What is image compression? 2021, 2015
Write down the difference between lossy and lossless
2 2015, 2013
compression method.
2020, 2013, 2014,
3 What is data redundancy?
2012
4 Identify the basic data redundancies. 2012
5 Describe the subjective and objective fidelity criteria. 2013
6 Explain lossy predictive coding. 2021, 2020, 2014
7 Explain lossless predictive coding model. 2012, 2011
Draw an image compression system and explain how it
8 2021, 2012
works.
What is image compression? What are the application areas
9 2013
of image compression?
How is an image compressed using JPEG image compression
10 2013
standard?
Describe the working principle of channel encoder and
11 2020
decoder.
Chapter 6
Image compression

1. What is image compression? [2015]


Answer:
Image compression is minimizing the size in bytes of a graphics file without degrading the quality of
the image to an unacceptable level. The reduction in file size allows more images to be stored in a given
amount of disk or memory space. It also reduces the time required for images to be sent over the Internet
or downloaded from Web pages.

2. Write down the difference between lossy and lossless compression method. [2015,2013]
BASIS FOR LOSSY COMPRESSION LOSSLESS COMPRESSION
COMPARISON

Basic Lossy compression is the Lossless compression is a group of


family of data encoding data compression algorithms that
method that utilizes imprecise permits the original data to be
estimates to represent the accurately rebuilt from the
content. compressed data.

Algorithm Transform coding, DCT, RLW, LZW, Arithmetic encoding,


DWT, fractal compression, Huffman encoding, Shannon Fano
RSSMS. coding.

Used in Images, audio and video. Text or program, images and


sound.

Application JPEG, GUI, MP3, MP4, RAW, BMP, PNG, WAV, FLAC,
OGG, H-264, MKV, etc. ALAC etc.

Data-holding More Less as compared to lossy method


capacity of the
channel
3. What is data redundancy? [2020,2013]
Or, What do you mean by data redundancy? [2014, 2012]
Answer: Data redundancy is a condition created within a database or data storage technology in which
the same piece of data is held in two separate places.
This can mean two different fields within a single database, or two different spots in multiple software
environments or platforms. Whenever data is repeated, this basically constitutes data redundancy.
This can occur by accident, but is also done deliberately for backup and recovery purposes.

If 𝑛1 and 𝑛2 denote the number of information-carrying units in two data sets that represent the same
information, the Relative Data Redundancy 𝑅𝐷 of the first data set can be defined as
1
𝑅𝐷 = 1 −
𝐶𝑅

Where, 𝐶𝑅 is compression ratio


𝑛1
𝐶𝑅 =
𝑛2

Case 1: if 𝑛2 = 𝑛1 , 𝐶𝑅 = 1 𝑎𝑛𝑑 𝑅𝐷 = 0 , indicating that (relative to the second data set) the first
representation of the information contains no redundant data.

Case 2: When 𝑛2 ≪ 𝑛1

𝐶𝑅 →∝ 𝑎𝑛𝑑 𝑅𝐷 → 1 ,

implying significant compression and highly redundant data.

Case-3: When 𝑛2 ≫ 𝑛1

𝐶𝑅 → 0 𝑎𝑛𝑑 𝑅𝐷 → −∝

Indicating that the second data set contains much more data than the original represented.

4. Identify the basic data redundancies. [2012]


Answer:
Within the general definition of data redundancy, there are different classifications based on what is
considered appropriate in database management, and what is considered excessive or wasteful. Wasteful
data redundancy generally occurs when a given piece of data does not have to be repeated, but ends up
being duplicated due to inefficient coding or process complexity.
A positive type of data redundancy works to safeguard data and promote consistency. Many developers
consider it acceptable for data to be stored in multiple places. The key is to have a central, master field
or space for this data, so that there is a way to update all of the places where data is redundant through
one central access point. Otherwise, data redundancy can lead to big problems with data inconsistency,
where one update does not automatically update another field. As a result, pieces of data that are
supposed to be identical end up having different values.
5. Describe the subjective and objective fidelity criteria. [2013]
Answer: The criteria for an assessment of a quality of an image are (i) Objective Fidelity Criteria and
(ii) Subjective Fidelity Criteria.
1. Objective Fidelity Criteria:
o Mean Square Error (MSE): Let f(x,y) represent an input image and let f^(x,y)f^(x,y) denote an
estimate or approximate of f(x,y) for any value of x and y, The mean squared error is defined as,

1. Subjective Fidelity Criteria:


• Images are viewed by human beings. Therefore measuring image quality by the subjective
evaluations of a human observer is more appropriate. This can be
accomplished by showing a typical decompressed image to an appropriate cross section of viewers
and averaging their evaluations.
• The evaluations may be made by using an absolute rating scale or by means of side by side
comparison of f(x,y)and f (̂ x,y).
• Side by side comparisons can be done with the following scale: - {1, 2, 3, 4, 5, 6}to represent
evaluations such as {Excellent, Fine, Passable, Marginal, Inferior, Unusable} respectively. - {-3, -
2, -1, 0, 1, 2, 3} to represent subjective evaluations such as {much worse, worse, slightly worse, the
same, slightly better, better, much better} respectively.

6. Explain lossy predictive coding. [2020,2014]


Or, Explain lossless predictive coding model. [2012]
Answer:
. If the data we are attempting to compress consists of numerical values, such as images, using context-
based approaches directly can be problematic.
ii. There are several reasons for this. Most context-based schemes exploit exact reoccurrence of patterns.
iii. Images are usually acquired using sensors that have a small amount of noise. While this noise may
not be perceptible, it is sufficient to reduce the occurrence of exact repetitions of patterns.
iv. A simple alternative to using the context approach is to generate a prediction for the value to be
encoded and encode the prediction error.
v. If there is considerable dependence among the values with high probability, the prediction will be
close to the actual value and the prediction error will be a small number.
vi. We can encode this small number, which as it occurs with high probability will require fewer bits to
encode
vii. By plotting histogram of the difference between neighbouring pixels. we can observe that small
differences occur much more frequently and therefore can be encoded using fewer bits.
viii. Because of the strong correlation between pixels in a neighbourhood, predictive coding has been
highly effective for image compression. It is used in the JPEG-LS, which is the standard for lossless
image compression.
ix. The function of the predictor is to obtain an estimate of the current sample based on the reconstructed
values of the past sample.
x. The requirement that the prediction algorithm use only the reconstructed values is to ensure that the
prediction at both the encoder and the decoder are identical.
xi. The reconstructed values used by the predictor, and the prediction algorithm, are dependent on the
nature of the data being encoded.
For example, for speech coding the predictor often uses the immediate past several values of the
sequence, along with a sample that is a pitch period away, to form the prediction.

7. Draw an image compression system and explain how it works. [2012]


Answer:
Image compression is an application of data compression that encodes the original image with few bits.
The objective of image compression is to reduce the redundancy of the image and to store or transmit
data in an efficient form
How Does Image Compression Work
There are two kinds of image compression methods - lossless vs lossy. Let’s take a quick look at them
both.
Lossless Compression#
Lossless compression is a method used to reduce the size of a file while maintaining the same quality
as before it was compressed. For example, in a DSLR camera, you probably have the option to save
photos as either RAW or JPEG. RAW files have no compression and are great if you’re a professional
photo editor. But they take up more space. JPEG, on the other hand, won’t fill up your hard drive as
fast, but some of the data is lost in the conversion.
Types of lossless images include:
• RAW - Found in many DSLRs, and keeps all the light data received from the camera’s sensor. For
a professional, this great news. However, these files types tend to be quite large in size.
Additionally, there are different versions of RAW, and you may need certain software to edit the
files.
• PNG - Compresses images to keep their small size by looking for patterns on a photo, and
compressing them together. The compression is reversible, so once you open a PNG file, the image
recovers exactly.
• BMP - A format found exclusively to Microsoft. It’s lossless, but not frequently used.
It should also be noted that converting a lossy photo back to lossless won’t restore the photo’s data.
Lossy Compression#
In order to give the photo an even smaller size, lossy compression discards some parts of a photo.
However, this doesn’t mean the photo will look bad. Here are the two main types of lossy compression.
JPG#
Also known as JPEG, this format gets rid of bits and pieces of a photo that you may notice depending
upon the level of compression you apply. A normal amount of compression will not be noticeable, while
extreme compression may be obvious.
There are also other ways a JPG image’s quality may be reduced. If you rotate the JPG too much, you’ll
notice a difference in quality. This is because the photo has to recompress itself with every rotation,
losing some data in the process. There are however programs out there that rotate a JPG losslessly. The
same degradation applies if you save a JPG multiple times.
GIF#
GIF compresses files by reducing the number of colors it has. If the photo has more than 256 colors
(the maximum amount of colors older computers could have) this format will make the image look less
appealing. The best use for GIFs are for images that are animated.
The example below shows a comparison between GIF images which range from 8 colors to 256 colors.

8. What is image compression? What are the application areas of image compression. [2013]
Answer:
Digital images are very large in size and hence occupy larger storage space. Due to their larger size,
they take larger bandwidth and more time for upload or download through the Internet. This makes it
inconvenient for storage as well as file sharing. To combat with this problem, the images are compressed
in size with special techniques. This compression not only helps in saving storage space but also enables
easy sharing of files. Image compression applications reduce the size of an image file without causing
major degradation to the quality of the image.
Image Compression Applications
Image compression applications make use of various techniques and algorithms in compressing images.
The techniques thus used by image compression applications can be classified as lossless and lossy
compression. The method of compression used depends on the desired quality of output. If the image
compression application is expected to produce a very high quality output without any loss in fidelity,
lossless compression technique is used. This technique is used where a high degree of accuracy is a
must. In applications where some quality can be compromised, lossy compression technique is used. In
lossy compression, there is minor loss of quality, but the loss is too little to be visible. This technique
is used in applications where a little compromise on quality of image is acceptable.

9. How an image is compressed using JPEG image compression standard? [2013]


Answer:
JPEG compression
JPEG stands for Joint photographic experts group. It is the first international standard in image
compression. It is widely used today. It could be lossy as well as lossless . But the technique we are
going to discuss here today is lossy compression technique.
How jpeg compression works
First step is to divide an image into blocks with each having dimensions of 8 x8.

Let’s for the record, say that this 8x8 image contains the following values.
The range of the pixels intensities now are from 0 to 255. We will change the range from -128 to 127.
Subtracting 128 from each pixel value yields pixel value from -128 to 127. After subtracting 128 from
each of the pixel value, we got the following results.

Now we will compute using this formula.

The result comes from this is stored in let’s say A(j,k) matrix.
There is a standard matrix that is used for computing JPEG compression, which is given by a matrix
called as Luminance matrix.
This matrix is given below
Applying the following formula

We got this result after applying.

Now we will perform the real trick which is done in JPEG compression which is ZIG-ZAG movement.
The zig zag sequence for the above matrix is shown below. You have to perform zig zag until you find
all zeroes ahead. Hence our image is now compressed.

Summarizing JPEG compression


The first step is to convert an image to Y’CbCr and just pick the Y’ channel and break into 8 x 8
blocks. Then starting from the first block, map the range from -128 to 127. After that you have to find
the discrete Fourier transform of the matrix. The result of this should be quantized. The last step is to
apply encoding in the zig zag manner and do it till you find all zero.

10. Write down the working principle of channel encoder and decoder.[2020]
Answer:

Channel encoder: The channel encoder introduces controlled redundancy, called parity bits, and the
channel decoder exploits the redundancy to facilitate the detection and correction of bit errors and thus
determine the actual transmitted input bit sequence.

Channel decoder: A channel decoder is used on the receiver side to return the binary information back
to its original form by removing the parity bits.

11.Draw an image compression system and explain how it works. [2020]

Answer:
f(x,y) Mapper Qunatizer Symbol Channel
encoder
Encoder

Channel Symbol Inverse f (x,y)


encoder mapper

The source encoder is responsible for reducing or eliminating any coding, Interpixel, or Psychovisual
redundancies in the input image. The specific application and associated fidelity requirements dictate
the best encoding approach for use in any given situation. Normally, the approach can be modeled by
a series of three independent operations.

1)Mapper

2)Quantizer

3)Symbol encoder
1) Mapper

i)The Mapper transforms the input data into a (usually nonvisual) format designed to reduce Interpixel
redundancies in the input image.
ii)This is reversible and may or may not reduce directly the amount of data required to represent the
image.
e.g. Run-length coding.

2) Quantizer

i)Reduces the accuracy of the Mapper’s output in accordance with some pre-established fidelity
criterion.
ii)Reduces the Psychovisual reduncies of the input image.
iii)Irreversible

3)Symbol encoder

i)Creates a fixed or variable length code to represent the Quantizer output and maps the output in
accordance with the code.
ii)It assigns the shortest code words to the most frequently occurring output values and thus reduces
coding redundancy.
12.Explain transform coding technique. [2016]

All the predictive coding techniques operate directly on the pixels of an image and thus are spatial
domain methods. In this coding, we consider compression techniques that are based on modifying the
transform of an image. In transform coding, a reversible, linear transform (such as the Fourier
transform) is used to map the image into a set of transform coefficients, which are then quantized and
coded. For most natural images, a significant number of the coefficients have small magnitudes and
can be coarsely quantized (or discarded entirely) with little image distortion. A variety of
transformations, including the discrete Fourier transform (DFT), can be used to transform the image
data.

You might also like