0% found this document useful (0 votes)
32 views14 pages

Image Compression Techniques Explained

This document discusses image compression techniques. It explains that image compression reduces the amount of data needed to represent an image by removing different types of redundancies, such as coding, interpixel, and psychovisual redundancies. Lossy compression techniques, like quantization, result in some loss of information and error between the original and reconstructed images. Common lossless techniques include Huffman coding, which assigns variable length codes to image data to minimize the number of bits used.

Uploaded by

Giannis
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)
32 views14 pages

Image Compression Techniques Explained

This document discusses image compression techniques. It explains that image compression reduces the amount of data needed to represent an image by removing different types of redundancies, such as coding, interpixel, and psychovisual redundancies. Lossy compression techniques, like quantization, result in some loss of information and error between the original and reconstructed images. Common lossless techniques include Huffman coding, which assigns variable length codes to image data to minimize the number of bits used.

Uploaded by

Giannis
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

IMAGE COMPRESSION

PRESENTATION OF THE 8 UNIT OF THE BOOK:


DIGITAL IMAGE COMPRESSION USING MATLAB BY RAFAEL C.
GONZALEZ, RICHARD E. WOODS, STEVEN L. EDDINS

IMAGE COMPRESSION
What does Image Compression do?
Reduces the amount of data needed to represent an image.

How ?
Image compression is achieved by compressing one or more of
three basic redundancies:
Coding redundancy
Interpixel redundancy
Psychovisual redundancy

GENERAL PIPELINE OF IMAGE


COMPRESSION
f(x,
y)

Mapper

Symbol
coder

Quantizer

Symbol
decoder

Inverse
Mapper

And the compression ratio is given by : C R = n1/n2

f(x,
y)

LOSSLESS OR LOSSY?
Lossless compression
The compressed image contain all the information needed for the exact
representation of the initial image.

Lossless compression
The compressed image has not the information for a exact representation of the
initial image. Thus, some level of distortion is present in the reconstructed image
So we can define an error between f(x,y) and f(x,y)

Depending on the importance of the data one could choose lossless or


lossy compression.

LOSSY

compression implies that some information will be lost


Lossy

during the compression procedure which cannot be restored.


So there will be an error between the initial image and the
reconstructed:
This is the error between each pixel. Thus, the total error is:
And the rms error between the two images is the square root
of the squared error averaged over the MxN image:

[Link] REDUNDANCY
Examples:
An intuitive approach: words such as yes and no ,which
are regularly used, are just one syllable.
The International Morse Code. This code has been designed
in order to minimize statistically the amount of data needed to
transmit messages.

[Link] REDUNDANCY
Let
the discrete random variable for k = 1,2,n and the
associated probabilities represent the gray levels of an L-grayimage. Then :
If the number of bits used to represent each value of is l(),
then the average number of bits required to represent each
pixel is
Thus the number of bits required to code an MxN image is MN.

[Link] REDUNDANCY
Example:

The table on the left shows two codes


Code 1and Code 2. At Code 1 the number of bits
coding each value (r.v.) is the same regardless its
probability. At Code 2 there is variable length. So the first code have = 2
And at Code 2 :
And the resulting compression rate is CR = 2/1.8125 = 1.103

HUFFMAN ALGORITHM
Huffman algorithm is a greedy algorithm. Greedy algorithms
tries to find localized optimum solution which may eventually
land in globally optimized solutions. But generally greedy
algorithms do not provide globally optimized solutions.

Thus a grey-scale image using encoded with Huffman algorithm


creates Huffman codes which contain the smallest possible
number of code symbols (bits) per source symbol (gray-scale
level).

HUFFMAN ENCODING USING HUFFMAN


TREES (+EXAMPLE)
In order to implement Huffman algorithm we use Huffman
trees.

The algorithm followed to build this tree :


Sort the list of probabilities and make the two-lowest elements into

leaves, creating a parent node with a probability that is the sum of the
two lower element's probabilities.
Then repeat the loop, combining the two lowest elements, until the
total probability is 1.
For every left turn put 1 and for every right turn put 0.

HUFFMAN DECODING USING HUFFMAN


TREES
The Huffman code is an instantaneous uniquely decodable
block code.
It is instantaneous because each code word in a string of code

symbols can be decoded without referring succeeding symbols.


It is uniquely decodable because a string of code words can be
decoded in only one way.

To decode a bitstream that have been encoded with Huffman


algorithm we need the Huffman code (dictionary).

HUFFMAN DECODING USING HUFFMAN


TREES
a1 0
a2 10
(EXAMPLE)
a3

110

Lets have the previous tree. The dictionary


is :
a4 111
a3a4a4a2a
1

encodin
g

110111111100

110 111 111 10 0

decoding a3a4a4a2a
1

[Link] REDUNDANCY
Unlike coding and interpixel redundancy, psychovisual
redundancy is associated with real or quantifiable visual
information.

The elimination of psychovisual redundant data results in a


loss of a quantitative information, called quantization. This
terminology is consistent with the normal usage of the word,
which generally mean the mapping of a broad range of input
values to a limited number of outputs values.

Quantization is a irreversible operation and results in lossy


compression

[Link] REDUNDANCY
Unlike coding and interpixel redundancy, psychovisual
redundancy is associated with real or quantifiable visual
information.

The elimination of psychovisual redundant data results in a


loss of a quantitative information, called quantization. This
terminology is consistent with the normal usage of the word,
which generally mean the mapping of a broad range of input
values to a limited number of outputs values.

Quantization is a irreversible operation and results in lossy


compression

Common questions

Powered by AI

Huffman encoding achieves efficient data compression by creating Huffman codes which contain the smallest possible number of code symbols (bits) per source symbol or gray-scale level. This is done using a greedy algorithm to build Huffman trees by sorting probabilities and combining the two lowest probability elements into a parent node. Each left turn in the tree stores a 1 and each right turn a 0, resulting in variable length codes that minimize the average number of bits per pixel. Huffman codes are both instantaneous and uniquely decodable, enabling compression without loss of information .

The justification for using lossy image compression lies in its significant ability to reduce data size while maintaining an image quality that is often perceptually indistinguishable from the original to human viewers. Lossy compression effectively increases storage and transmission efficiency, which is crucial for handling large image datasets, streaming, and limited bandwidth scenarios. The errors introduced are often strategically localized in less visually important components of the image, minimizing noticeable quality loss while maximizing compression benefits .

Interpixel redundancy refers to the redundancy that arises because neighboring pixels in an image are often correlated, containing similar or predictable intensity levels. This redundancy can be reduced by representing the image based on the differences between pixel values rather than the absolute values, which helps in compressing the data. Techniques that exploit interpixel redundancy contribute to more compact representations of the image, increasing the efficiency of image compression .

The primary limitation of the Huffman algorithm is that, while it provides an efficient localized optimal solution for encoding based on the frequencies of source symbols, it does not guarantee a globally optimal compression ratio under all circumstances. This is due to its greedy nature, which might lead to suboptimal decisions that do not align with the best possible global compression. Additionally, Huffman coding does not exploit interpixel or psychovisual redundancies, potentially leaving further compression opportunities untapped .

The compression ratio in image compression is a measure of the effectiveness of a compression algorithm in reducing the data size of an image. It is calculated as the ratio of the original image size (n1) to the compressed image size (n2), expressed as CR = n1/n2. A higher compression ratio indicates a greater reduction in data size, which is desirable for storage and transmission efficiency .

Coding redundancy involves reducing the number of bits required to represent image data by taking advantage of statistical probabilities of pixel values, akin to choosing efficient data codes like Morse code. Psychovisual redundancy, on the other hand, involves the removal of visually less important data based on human perception, resulting in quantization. While coding redundancy can lead to lossless compression, psychovisual redundancy inherently leads to lossy compression due to irreversible data elimination .

The process of Huffman decoding involves navigating a Huffman tree using the encoded bitstream to retrieve the original symbols corresponding to each bit pattern. The main advantage is that it allows efficient and unique decoding, as the Huffman code is both instantaneous and uniquely decodable. This property ensures that each codeword can be interpreted without ambiguity and without needing to look ahead in the bitstream, streamlining the decoding process and preserving data integrity .

In the image compression pipeline, the symbol coder is responsible for converting image data into a stream of symbols using an efficient coding scheme, such as Huffman coding, which minimizes the number of bits used. The symbol decoder performs the reverse operation, converting the encoded symbols back into the original or approximate image data. This process is crucial for reducing the size of the image data during storage or transmission and then accurately retrieving it when needed .

In image compression, psychovisual redundancy is addressed by exploiting the human eye's lower sensitivity to certain visual information. Quantization is used to map a broad range of input values to fewer output values, thereby discarding less important information. This process, however, leads to lossy compression as it is irreversible. While quantization significantly reduces the data size, it can introduce distortions in the reconstructed image that may affect perceived image quality, especially at higher compression levels. The challenge is to balance compression efficiency with acceptable quality loss .

Lossless image compression reduces the image data size without any loss of information, enabling the exact original image to be reconstructed from the compressed data. It is achieved by reducing coding redundancy. In contrast, lossy image compression reduces the data size by removing psychovisual data deemed less important by human perception, resulting in some level of distortion and an irreversible loss of information. Therefore, in lossless compression, quality is preserved while in lossy compression, there is a trade-off between compression efficiency and image quality .

You might also like