CH 6
CH 6
Basic Contents:
Overview
Techniques
1
6.1. Image Compression
refers to the process applied to a graphics file to minimize its size in
bytes without degrading image quality below an acceptable threshold.
2
Cont.
Basic steps in image compression:
Applying the image transform
Quantization of the levels
Encoding the sequences.
3
6.2. Image Compression Techniques
I. Lossy
II. Lossless
Both reduce image file sizes, but they differ in methods and results.
But, lossy removes some of the image data permanently, while
lossless does not reduce image quality and only removes non-
essential data.
4
6.2.1 Lossy Image Compression
It is a process that removes some of the data from your image file,
reducing the overall file size.
It is irreversible (file information will be removed permanently).
Techniques:
Discrete wavelet transform coding
fractal compression
transform encryption.
5
Cont.
a) Wavelet Coding: is based on the idea that the coefficients of a
transform that decorrelates the pixels of an image can be coded more
efficiently than the original pixels themselves.
If the transform's basis functions, wavelets(Ψ), pack most of the
important visual information into a small number of coefficients, the
remaining coefficients can be quantized coarsely or truncated to zero
with little image distortion.
6
Cont.
b) Fractal Compression: the image is divided into sub-blocks, then for
each block , if the most similar block is found in a half size version of
the image and stored. This is done for each block and then during
decompression, the opposite is done iteratively to recover the original
image.
7
6.2.2. Lossless Image Compression
It is a process that reduces the size of an image without any
quality loss..
It restores and rebuilds file data in its original form after the file is
decompressed without any data loss but less file size (reversable).
Goal:
to represent an image signal with the smallest possible number of bits
without loss of any information, thereby speeding up transmission and
minimizing storage requirements.
8
Cont.
Algorithms :
Run Length Encoding
Lempel-Ziv-Welch (LZW)
Huffman Coding
Arithmetic Encoding
9
Cont.
i. Run Length Encoding
helps us encode large runs of repeating items by only sending one
item from the run and a counter showing how many times this item is
repeated.
is useless when trying to compress natural language texts, because
they don’t have long runs of repeating elements, but, useful when it
comes to image compression, because images happen to have long
runs pixels with identical colour.
10
Cont.
e.g.
11
Cont.
ii. Huffman Encoding
used to compress all sorts of data.
source symbols can be either pixel intensities of the Image, or the
output of an intensity mapping function.
minimize the data’s total code length by assigning codes of variable
lengths to each of its data chunks based on its frequencies in the data.
High-frequency chunks get assigned with shorter code and lower-
frequency ones with relatively longer code, making a compression
factor ≥ 1.
12
Cont.
Encoding 3D image: dimensions of the image and intensities of each
pixel:
Let there are r rows, c columns, and d channels for the image:
then we need to encode r*c*d +3, i.e. r*c*d intensities and 3D r, c, d.
13