SlideShare ist ein Scribd-Unternehmen logo
1 von 56
DIGITAL IMAGE PROCESSING
IMAGE COMPRESSION
Introduction
 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.
Introduction
 Tounderstand 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
Introduction
Thus a 2 hour movie consists of
31,104,000 bps x (602) sph x 2 hrs ≈ 2.24 x 1011 bytes.
OR
224GB ofdata
sph = second per hour
 Twenty seven 8.5GB dual layer DVDs are needed to store it.
 Toput 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.
Introduction
 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.
Introduction
 Along with these applications , image compression plays an
important role in many other areas including:
Fundamentals
 Data Compression: It refers to the process of reducing the
amount of data required to represent a given quantity of
information.
Data
Vs
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.
Fundamentals
Fundamentals
 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.
So, R = 0.9, indicating that 90% of its data is redundant.
Fundamentals
 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.
Fundamentals
2) Spatial & 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:
 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.
Fundamentals
1) Coding Redundancy:
 Assume a discrete random variable rk in interval [0 – L-1] is
used to represent the intensities of an M x N image.
 Also the each rk occurs with probability pr (rk).
 pr(rk) = nk / MN k = 0, 1, 2, ………….L-1 -----(a)
 Where, L is no. of intensity values &
nk is no. of times kth intensity appears in the image.
If no. of bits used to represent each value of rk is l(rk), then avg
no of bits required to represent each pixel is
L - 1
Lavg = Σ l(rk)pr(rk)
k = 0
Thus, total no. of bits required to represent an MxN image is
MNLavg.
Fundamentals
 If the intensities are represented using a natural m-bits fixed
length code, the RHS reduces to m bits.
 i.e. Lavg = m where m is substituted forl(rk).
 Constant m can be taken out the summation leaving only
sum of pr(rk) for 0 ≤ k ≤ L-1, which = 1.
Fundamentals
With respect to the above table, If a natural 8-bit binary code is
used to represent its 4 possible intensities, Lavg = 8, cozl1(rk)
= 8 bits for all rk.
On the other hand, If code 2 scheme is used, the avg length of
encoded pixels is,
Lavg = 0.25(2) + 0.47(1) + 0.25(3) + 0.03(3) = 1.81bits.
Total no. of bits rqd to represent entire image = MNLavg
= 256 x 256 x 1.81 = 118,621
Resulting compression
C = 256 x 256 x 8 / 118,621 = 8 / 1.81 ≈ 4.42
Relative redundancy
R = 1 – 1/4.42 = 0.774
Thus, 77.4% of data in original 8-bit 2D intensity array is
redundant.
Fidelity Criteria
Fidelity Criteria:
• Removal of irrelevant visual information involves a loss of
real or quantitative image information.
• Since information is lost, a means of quantifying the nature
of loss is needed.
Objective fidelity criteria Subjective fidelity criteria
 Objective fidelity criteria: When information loss can be
expressed as a mathematical function of input & output of a
compression process. Eg RMS error between 2 images.
Error between two images
e(x, y) = f’(x, y) – f(x, y)
So, total error between two images
M-1 N-1
Σ Σ *f’(x, y) – f(x, y)]
x=0 y = 0
Fidelity Criteria
RMS error is given by
M-1 N-1
erms = [(1/MN)Σ Σ *f’(x, y) – f(x,y)]2]1/2
x=0 y = 0
If f’(x, y) is considered to be the sum of original image f(x, y) & an
error or noise signal e(x, y), the Mean Square SNR of output
image denoted by SNRrms can be defined as
SNRrms =
M-1 N-1
Σ Σ f’(x, y)2
x=0 y = 0
M-1 N-1
Σ Σ *f’(x, y) – f(x, y)]2
x=0 y = 0
Fidelity Criteria
 Subjective fidelity criteria:
• A Decompressed image is presented to a cross section of
viewers and averaging their evaluations.
• It can be done by using an absolute rating scale
Or
• By means of side by side comparisons of f(x, y) & f’(x, y).
• Side by Side comparison can be done with a scale such as
{-3, -2, -1, 0, 1, 2, 3}
to represent the subjective valuations
{much worse, worse, slightly worse, the same, slightly
better, better, much better} respectively.
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.
Image Compression Models
• Input image f(x,…..) 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,…..) 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.
Image
Compression
Models
Mapper Quantizer
Symbol
coder
Symbol
Decoder
Inverse
Mapper
Image Compression Models
Encoding or Compression process:
Encoder is used to remove the redundancies through a series of
3 independent operations.
Mapper: It transforms f(x,…) into a format designed to reduce
spatial and temporal redundancies.
• It is reversible
• It may / may not reduce the amount of data to represent
image.
Ex. Run Length coding
• In video applications, mapper uses previous frames to
remove temporal redundancies.
Image Compression Models
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.
Image Compression Models
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.
Image Compression Models
Decoding or Decompression process:
• Quantization results in irreversible loss, an inverse quantizer
block is not included in the decoder block.
Some Basic Compression Methods
Huffman Coding:
• Most popular technique for removing coding redundancies.
• It yields smallest possible code symbol per source symbol.
Original Source Source reduction
Symbol Probability 1 2 3 4
a2 0.4 0.4 0.4 0.4 0.6
a6 0.3 0.3 0.3 0.3 0.4
a1 0.1 0.1 0.2 0.3
a4 0.1 0.1 0.1
a3 0.06 0.1
a5 0.04
Some Basic Compression Methods
Huffman Coding:
Original Source Source reduction
Symbol Probability Code 1 2 3 4
a2 0.4 1 0.4 1 0.4 1 0.4 1 0.6 0
a6 0.3 00 0.3 00 0.3 00 0.3 00 0.4 1
a1 0.1 011 0.1 011 0.2 010 0.3 01
a4 0.1 0100 0.1 0100 0.1 011
a3 0.06 01010 0.1 0101
a5 0.04 01011
Lavg = (0.4)(1) + (0.3)(2) + (0.1)(3) + (0.06)(5) +(0.04)(5)
= 2.2 bits / pixel.
Some Basic Compression Methods
Huffman Coding:
• It is instantaneous.
• Coz each code word in a string of code symbols can be
decoded without referencing succeeding symbols.
• It is uniquely decodable.
• Coz any string of code symbols can be decoded by examining
individual symbols of string from left to right.
Ex. 010100111100
Some Basic Compression Methods
Huffman Coding:
• It is instantaneous.
• Coz each code word in a string of code symbols ca be
decoded without referencing succeeding symbols.
• It is uniquely decodable.
• Coz any string of code symbols can be decoded by examining
individual symbols of string from left to right.
Ex. 01010 011 1 1 00
First valid code:
01010 – a3,
011 – a1,
Thus, completely decoding the message, we get, a3a1a2a2a6
Some Basic Compression Methods
Arithmetic coding:
It generates non block codes.
One to One correspondence between source symbols and code
words does not exist.
Instead, an entire sequence of source symbols is assigned a
single arithmetic code.
Code word defines an integer of real numbers between 0 & 1.
As No. of symbols in msg.
interval to represent it
no. of bits to represent info
Each symbol of msg size of interval in accordance with its
probability of occurrence.
Some Basic Compression Methods
Basic Arithmetic coding process:
5 symbol message, a1a2a3a3a4 from 4 symbol source is coded.
Source Symbol Probability Initial Subinterval
a1 0.2 [0.0, 0.2)
a2 0.2 [0.2, 0.4)
a3 0.4 [0.4, 0.8)
a4 0.2 [0.8, 1.0)
Some Basic Compression Methods
Arithmetic coding:
a1 a2 a3 a3 a4
1 0.2 0.08 0.072 0.0688
a4 a4 a4 a4 a4
a3 a3 a3 a3 a3
a2 a2 a2 a2 a2
a1 a1 a1 a1 a1
0 0 0.04 0.056 0.0624
Some Basic Compression Methods
Arithmetic coding:
a1 a2 a3 a3 a4
1 0.2 0.08 0.072 0.0688
a4 a4 a4 a4 a4
a3 a3 a3 a3 a3
a2 a2 a2 a2 a2
a1 a1 a1 a1 a1
0 0 0.04 0.056 0.0624
Some Basic Compression Methods
Arithmetic coding:
a1 a2 a3 a3 a4
1 0.2 0.08 0.072 0.0688
a4 a4 a4 a4 a4
a3 a3 a3 a3 a3
a2 a2 a2 a2 a2
a1 a1 a1 a1 a1
0 0 0.04 0.056 0.0624
Some Basic Compression Methods
Arithmetic coding:
a1 a2 a3 a3 a4
1 0.2 0.08 0.072 0.0688
a4 a4 a4 a4 a4
a3 a3 a3 a3 a3
a2 a2 a2 a2 a2
a1 a1 a1 a1 a1
0 0 0.04 0.056 0.0624
Some Basic Compression Methods
Arithmetic coding:
a1 a2 a3 a3 a4
1 0.2 0.08 0.072 0.0688
a4 a4 a4 a4 a4
a3 a3 a3 a3 a3
a2 a2 a2 a2 a2
a1 a1 a1 a1 a1
0 0 0.04 0.056 0.0624
Some Basic Compression Methods
Arithmetic coding: Encoding Sequence 
a1 a2 a3 a3 a4
1 0.2 0.08 0.072 0.0688
a4 a4 a4 a4 a4
a3 a3 a3 a3 a3
a2 a2 a2 a2 a2
a1 a1 a1 a1 a1
0 0 0.04 0.056 0.0624
Some Basic Compression Methods
The final message symbol narrows to [0.06752, 0.0688).
Any number between this interval can be used to represent the
message.
Eg. 0.068
3 decimal digits are used to represent the 5 symbol message.
Some Basic Compression Methods
LZW Coding:
 LZW – Lempel-Ziv-Welch coding
 Error free compression approach that also addresses spatial
redundancies in an image.
 It assigns fixed-length code words to variable length
sequences of source symbols.
 It requires no prior knowledge of probability of occurrence of
the symbols to be encoded.
Some Basic Compression Methods
LZW Coding:
 It is conceptually very simple.
 Initially, a codebook or dictionary containing the source
symbols to be coded is constructed.
 For an 8-bit BW images, the first 256 words of dictionary are
assigned to intensities 0, 1, 2, …., 255.
Some Basic Compression Methods
LZW Coding:
Consider the 4 x 4 8-bit image having a vertical edge.
39 39 126 126
39 39 126 126
39 39 126 126
39 39 126 126
A 512-word dictionary with following content is assumed:
-
.
Dictionary Location Entry
0 0
1 1
. .
. .
255 255
256
.
511 -
Some Basic Compression
Methods
Currently
Recognized
Sequence
Pixel Being
Processed
Encoded
Output
Dictionary
Location
Dictionary
Entry
39
39 39 39 256 39-39
39 126 39 257 39-126
126 126 126 258 126-126
126 39 126 259 126-39
39 39
39-39 126 256 260 39-39-126
126 126
126-126 39 258 261 126-126-39
39 39
39-39 126
39-39-126 126 260 262 39-39-126-126
126 39
126-39 39 259 263 126-39-39
39 126
39-126 126 257 264 39-126-126
126 126
Some Basic Compression Methods
Unique feature of LZW coding:
 Coding dictionary or code book is created while data are
being encoded.
Some Basic Compression Methods
Bit-plane coding:
 Another effective method to reduce interpixel redundancies.
 Image’s bit planes are processed individually.
 Based on decomposing a multilevel (monochrome / color)
image into a series of binary images & compressing each
binary using any binary compression method.
Bit plane decomposition:
 Gray levels of an m-bit gray level image can be represented
in form of base 2 polynomial.
am-12m-1+am-22m-2+……..+a121+a020 ………(1)
Some Basic Compression Methods
 A simple method of decomposing the image into a collection
of binary image is to separate the m coefficients of the
polynomial into m-1 bit planes.
Disadvantage:
 Small changes in gray level can have significant impact on
complexity of bit planes.
Ex. If two adjacent pixels have intensity of 127 (01111111) and
128 (10000000), every bit plane will contain a corresponding
0 to 1 (or 1 to 0) transition.
Some Basic Compression Methods
Alternate decomposition approach:
 Reduces the effect of small gray level variations.
 Requires the representation of image into m-bit gray code.
 m-bit gray code gm-1…..g2g1g0 can be computed from
gi = ai xor ai+1 0 ≤ i ≤ m-2
gm-1 = am-1
 This code has unique property that successive code words
differ by only 1 bit position.
 Small changes in gray level are less likely to affect all m bit
planes.
Ex. 127 (11000000) & 128 (01000000).
Some Basic Compression Methods
Run-Length Coding:
 Standard compression approach used in facsimile (FAX).
 Basic concept is to code each contiguous group of 0’s & 1’s
encountered in L to R scan of a row by its length & to develop
a convention for determining the value of run.
 Most common approach for determining the value of run:
i) Specify value of first run of each row.
ii) Toassume each row begins with a white run whose run
length may in fact be zero.
Some Basic Compression Methods
• Although Run length coding is in itself an effective method of
compressing an image, additional compression can be realized
by variable-length coding.
• Black & white run lengths may be coded separately using
variable-length codes.
Ex. If aj represent a black run of length j, we can estimate its
probability.
• The approximate run-length entropy of the image is:
HRL = (H0 + H1) / (L0 + L1)
• where, L0 & L1 denote average values of black & white run
lengths resp.
• Above equation also provides an estimate of the average no.
of bits per pixel required to code the run lengths in a binary
image.
Some Basic Compression Methods
Lossless predictive coding:
• Based on eliminating the interpixel redundancies of closely
spaced pixels by extracting & coding only the new information
in each pixel.
• New information: difference between the actual & predicted
value of that pixel.
Some Basic Compression Methods
•Figure shows basic component of a lossless predictive
coding system.
•It consists of an encoder & a decoder each containing an
identical predictor.
•As each successive pixel of input image f(n) is introduced to
the encoder, predictor generates its anticipated value.
Output of the predictor is then rounded to the nearest integer
f(n)bar & used to form the difference or prediction error.
e(n) = f(n)– f(n)bar
Some Basic Compression Methods
• It is coded using a variable length to generate the next
element of the compressed data stream.
• The decoder reconstruct the fn from the received variable-
length code words & perform the inverse operation
• f(n) = e(n) + f(n)bar
• f(n)bar is generated by prediction formed by a linear
combination of m previous pixels.
m
f(n)bar = round[Σ αi f(n-i)] where, m – order of linear predictori = 1
round – function used to denote rounding
αi – for i = 1, 2, 3, ….. m are predictioncoefficients.
SOME BASIC COMPRESSION METHODS
Lossy Predictive coding:
Some Basic Compression Methods
Lossy Predictive coding:
• In this method we add a quantizer to the lossless predictive
coding model.
• It replaces the nearest integer function & is placed between
symbol encoder & point where prediction error forms.
• It maps the prediction error into a limited range of outputs
denoted by ë(n), which establish the amount of compression
& distortion.
• In order to accommodate the insertion of the quantization
step, the error free encoder must be altered so that the
predictions by the encoder & decoder are equivalent.
Some Basic Compression Methods
Lossy Predictive coding:
• This is accomplished by placing the predictor within a
feedback loop, where its input ƒ(n)dot is generated as a
function of past predictions & quantized errors.
ƒ(n)dot = e(n)dot + f(n)bar
• This closed loop configuration prevents error buildup at the
decoder’s output.

Weitere ähnliche Inhalte

Was ist angesagt?

Wavelet based image compression technique
Wavelet based image compression techniqueWavelet based image compression technique
Wavelet based image compression techniquePriyanka Pachori
 
Smoothing Filters in Spatial Domain
Smoothing Filters in Spatial DomainSmoothing Filters in Spatial Domain
Smoothing Filters in Spatial DomainMadhu Bala
 
Digital Image restoration
Digital Image restorationDigital Image restoration
Digital Image restorationMd Shabir Alam
 
Digital image processing
Digital image processingDigital image processing
Digital image processingABIRAMI M
 
Image processing second unit Notes
Image processing second unit NotesImage processing second unit Notes
Image processing second unit NotesAAKANKSHA JAIN
 
Image Enhancement in Spatial Domain
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial DomainDEEPASHRI HK
 
Image restoration and degradation model
Image restoration and degradation modelImage restoration and degradation model
Image restoration and degradation modelAnupriyaDurai
 
Motion estimation overview
Motion estimation overviewMotion estimation overview
Motion estimation overviewYoss Cohen
 
Lecture 1 for Digital Image Processing (2nd Edition)
Lecture 1 for Digital Image Processing (2nd Edition)Lecture 1 for Digital Image Processing (2nd Edition)
Lecture 1 for Digital Image Processing (2nd Edition)Moe Moe Myint
 
Lecture 4 Relationship between pixels
Lecture 4 Relationship between pixelsLecture 4 Relationship between pixels
Lecture 4 Relationship between pixelsVARUN KUMAR
 
4.intensity transformations
4.intensity transformations4.intensity transformations
4.intensity transformationsYahya Alkhaldi
 
Introduction to Image Compression
Introduction to Image CompressionIntroduction to Image Compression
Introduction to Image CompressionKalyan Acharjya
 
SPATIAL FILTERING IN IMAGE PROCESSING
SPATIAL FILTERING IN IMAGE PROCESSINGSPATIAL FILTERING IN IMAGE PROCESSING
SPATIAL FILTERING IN IMAGE PROCESSINGmuthu181188
 
Chapter 1 and 2 gonzalez and woods
Chapter 1 and 2 gonzalez and woodsChapter 1 and 2 gonzalez and woods
Chapter 1 and 2 gonzalez and woodsasodariyabhavesh
 
Sharpening using frequency Domain Filter
Sharpening using frequency Domain FilterSharpening using frequency Domain Filter
Sharpening using frequency Domain Filterarulraj121
 
Digital Image Fundamentals
Digital Image FundamentalsDigital Image Fundamentals
Digital Image FundamentalsA B Shinde
 
Frequency domain methods
Frequency domain methods Frequency domain methods
Frequency domain methods thanhhoang2012
 

Was ist angesagt? (20)

Wavelet based image compression technique
Wavelet based image compression techniqueWavelet based image compression technique
Wavelet based image compression technique
 
Noise Models
Noise ModelsNoise Models
Noise Models
 
JPEG Image Compression
JPEG Image CompressionJPEG Image Compression
JPEG Image Compression
 
image compression ppt
image compression pptimage compression ppt
image compression ppt
 
Smoothing Filters in Spatial Domain
Smoothing Filters in Spatial DomainSmoothing Filters in Spatial Domain
Smoothing Filters in Spatial Domain
 
Digital Image restoration
Digital Image restorationDigital Image restoration
Digital Image restoration
 
Digital image processing
Digital image processingDigital image processing
Digital image processing
 
Image processing second unit Notes
Image processing second unit NotesImage processing second unit Notes
Image processing second unit Notes
 
Image Enhancement in Spatial Domain
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial Domain
 
Image restoration and degradation model
Image restoration and degradation modelImage restoration and degradation model
Image restoration and degradation model
 
Motion estimation overview
Motion estimation overviewMotion estimation overview
Motion estimation overview
 
Lecture 1 for Digital Image Processing (2nd Edition)
Lecture 1 for Digital Image Processing (2nd Edition)Lecture 1 for Digital Image Processing (2nd Edition)
Lecture 1 for Digital Image Processing (2nd Edition)
 
Lecture 4 Relationship between pixels
Lecture 4 Relationship between pixelsLecture 4 Relationship between pixels
Lecture 4 Relationship between pixels
 
4.intensity transformations
4.intensity transformations4.intensity transformations
4.intensity transformations
 
Introduction to Image Compression
Introduction to Image CompressionIntroduction to Image Compression
Introduction to Image Compression
 
SPATIAL FILTERING IN IMAGE PROCESSING
SPATIAL FILTERING IN IMAGE PROCESSINGSPATIAL FILTERING IN IMAGE PROCESSING
SPATIAL FILTERING IN IMAGE PROCESSING
 
Chapter 1 and 2 gonzalez and woods
Chapter 1 and 2 gonzalez and woodsChapter 1 and 2 gonzalez and woods
Chapter 1 and 2 gonzalez and woods
 
Sharpening using frequency Domain Filter
Sharpening using frequency Domain FilterSharpening using frequency Domain Filter
Sharpening using frequency Domain Filter
 
Digital Image Fundamentals
Digital Image FundamentalsDigital Image Fundamentals
Digital Image Fundamentals
 
Frequency domain methods
Frequency domain methods Frequency domain methods
Frequency domain methods
 

Ähnlich wie Image compression 14_04_2020 (1)

Image compression
Image compressionImage compression
Image compressionIshucs
 
Paper id 25201490
Paper id 25201490Paper id 25201490
Paper id 25201490IJRAT
 
Image_Compression_Slide_Set_1.pptx
Image_Compression_Slide_Set_1.pptxImage_Compression_Slide_Set_1.pptx
Image_Compression_Slide_Set_1.pptxssuserd546c51
 
A REVIEW ON LATEST TECHNIQUES OF IMAGE COMPRESSION
A REVIEW ON LATEST TECHNIQUES OF IMAGE COMPRESSIONA REVIEW ON LATEST TECHNIQUES OF IMAGE COMPRESSION
A REVIEW ON LATEST TECHNIQUES OF IMAGE COMPRESSIONNancy Ideker
 
Iaetsd performance analysis of discrete cosine
Iaetsd performance analysis of discrete cosineIaetsd performance analysis of discrete cosine
Iaetsd performance analysis of discrete cosineIaetsd Iaetsd
 
Digital Image Processing
Digital Image ProcessingDigital Image Processing
Digital Image ProcessingAnkur Nanda
 
Digital Image Processing - Image Compression
Digital Image Processing - Image CompressionDigital Image Processing - Image Compression
Digital Image Processing - Image CompressionMathankumar S
 
image basics and image compression
image basics and image compressionimage basics and image compression
image basics and image compressionmurugan hari
 
notes_Image Compression_edited.ppt
notes_Image Compression_edited.pptnotes_Image Compression_edited.ppt
notes_Image Compression_edited.pptHarisMasood20
 
Why Image compression is Necessary?
Why Image compression is Necessary?Why Image compression is Necessary?
Why Image compression is Necessary?Prabhat Kumar
 
notes_Image Compression.ppt
notes_Image Compression.pptnotes_Image Compression.ppt
notes_Image Compression.pptHarisMasood20
 
notes_Image Compression.ppt
notes_Image Compression.pptnotes_Image Compression.ppt
notes_Image Compression.pptHarisMasood20
 
Seminar Report on image compression
Seminar Report on image compressionSeminar Report on image compression
Seminar Report on image compressionPradip Kumar
 
Image compression and it’s security1
Image compression and it’s security1Image compression and it’s security1
Image compression and it’s security1Reyad Hossain
 
IRJET-Lossless Image compression and decompression using Huffman coding
IRJET-Lossless Image compression and decompression using Huffman codingIRJET-Lossless Image compression and decompression using Huffman coding
IRJET-Lossless Image compression and decompression using Huffman codingIRJET Journal
 
Image compression
Image compressionImage compression
Image compressionHuda Seyam
 

Ähnlich wie Image compression 14_04_2020 (1) (20)

Image compression
Image compressionImage compression
Image compression
 
Image compression .
Image compression .Image compression .
Image compression .
 
Paper id 25201490
Paper id 25201490Paper id 25201490
Paper id 25201490
 
Image_Compression_Slide_Set_1.pptx
Image_Compression_Slide_Set_1.pptxImage_Compression_Slide_Set_1.pptx
Image_Compression_Slide_Set_1.pptx
 
A REVIEW ON LATEST TECHNIQUES OF IMAGE COMPRESSION
A REVIEW ON LATEST TECHNIQUES OF IMAGE COMPRESSIONA REVIEW ON LATEST TECHNIQUES OF IMAGE COMPRESSION
A REVIEW ON LATEST TECHNIQUES OF IMAGE COMPRESSION
 
Iaetsd performance analysis of discrete cosine
Iaetsd performance analysis of discrete cosineIaetsd performance analysis of discrete cosine
Iaetsd performance analysis of discrete cosine
 
Digital Image Processing
Digital Image ProcessingDigital Image Processing
Digital Image Processing
 
Digital Image Processing - Image Compression
Digital Image Processing - Image CompressionDigital Image Processing - Image Compression
Digital Image Processing - Image Compression
 
image basics and image compression
image basics and image compressionimage basics and image compression
image basics and image compression
 
notes_Image Compression_edited.ppt
notes_Image Compression_edited.pptnotes_Image Compression_edited.ppt
notes_Image Compression_edited.ppt
 
Image compression and jpeg
Image compression and jpegImage compression and jpeg
Image compression and jpeg
 
Why Image compression is Necessary?
Why Image compression is Necessary?Why Image compression is Necessary?
Why Image compression is Necessary?
 
Data Redundacy
Data RedundacyData Redundacy
Data Redundacy
 
notes_Image Compression.ppt
notes_Image Compression.pptnotes_Image Compression.ppt
notes_Image Compression.ppt
 
notes_Image Compression.ppt
notes_Image Compression.pptnotes_Image Compression.ppt
notes_Image Compression.ppt
 
Seminar Report on image compression
Seminar Report on image compressionSeminar Report on image compression
Seminar Report on image compression
 
Image compression
Image compressionImage compression
Image compression
 
Image compression and it’s security1
Image compression and it’s security1Image compression and it’s security1
Image compression and it’s security1
 
IRJET-Lossless Image compression and decompression using Huffman coding
IRJET-Lossless Image compression and decompression using Huffman codingIRJET-Lossless Image compression and decompression using Huffman coding
IRJET-Lossless Image compression and decompression using Huffman coding
 
Image compression
Image compressionImage compression
Image compression
 

Kürzlich hochgeladen

Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 

Kürzlich hochgeladen (20)

Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 

Image compression 14_04_2020 (1)

  • 2. Introduction  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.
  • 3. Introduction  Tounderstand 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
  • 4. Introduction Thus a 2 hour movie consists of 31,104,000 bps x (602) sph x 2 hrs ≈ 2.24 x 1011 bytes. OR 224GB ofdata sph = second per hour  Twenty seven 8.5GB dual layer DVDs are needed to store it.  Toput 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.
  • 5. Introduction  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.
  • 6. Introduction  Along with these applications , image compression plays an important role in many other areas including:
  • 7. Fundamentals  Data Compression: It refers to the process of reducing the amount of data required to represent a given quantity of information. Data Vs 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.
  • 9. Fundamentals  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. So, R = 0.9, indicating that 90% of its data is redundant.
  • 10. Fundamentals  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.
  • 11. Fundamentals 2) Spatial & 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:  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.
  • 12.
  • 13.
  • 14.
  • 15. Fundamentals 1) Coding Redundancy:  Assume a discrete random variable rk in interval [0 – L-1] is used to represent the intensities of an M x N image.  Also the each rk occurs with probability pr (rk).  pr(rk) = nk / MN k = 0, 1, 2, ………….L-1 -----(a)  Where, L is no. of intensity values & nk is no. of times kth intensity appears in the image. If no. of bits used to represent each value of rk is l(rk), then avg no of bits required to represent each pixel is L - 1 Lavg = Σ l(rk)pr(rk) k = 0 Thus, total no. of bits required to represent an MxN image is MNLavg.
  • 16. Fundamentals  If the intensities are represented using a natural m-bits fixed length code, the RHS reduces to m bits.  i.e. Lavg = m where m is substituted forl(rk).  Constant m can be taken out the summation leaving only sum of pr(rk) for 0 ≤ k ≤ L-1, which = 1.
  • 17. Fundamentals With respect to the above table, If a natural 8-bit binary code is used to represent its 4 possible intensities, Lavg = 8, cozl1(rk) = 8 bits for all rk. On the other hand, If code 2 scheme is used, the avg length of encoded pixels is, Lavg = 0.25(2) + 0.47(1) + 0.25(3) + 0.03(3) = 1.81bits. Total no. of bits rqd to represent entire image = MNLavg = 256 x 256 x 1.81 = 118,621 Resulting compression C = 256 x 256 x 8 / 118,621 = 8 / 1.81 ≈ 4.42 Relative redundancy R = 1 – 1/4.42 = 0.774 Thus, 77.4% of data in original 8-bit 2D intensity array is redundant.
  • 18. Fidelity Criteria Fidelity Criteria: • Removal of irrelevant visual information involves a loss of real or quantitative image information. • Since information is lost, a means of quantifying the nature of loss is needed. Objective fidelity criteria Subjective fidelity criteria  Objective fidelity criteria: When information loss can be expressed as a mathematical function of input & output of a compression process. Eg RMS error between 2 images. Error between two images e(x, y) = f’(x, y) – f(x, y) So, total error between two images M-1 N-1 Σ Σ *f’(x, y) – f(x, y)] x=0 y = 0
  • 19. Fidelity Criteria RMS error is given by M-1 N-1 erms = [(1/MN)Σ Σ *f’(x, y) – f(x,y)]2]1/2 x=0 y = 0 If f’(x, y) is considered to be the sum of original image f(x, y) & an error or noise signal e(x, y), the Mean Square SNR of output image denoted by SNRrms can be defined as SNRrms = M-1 N-1 Σ Σ f’(x, y)2 x=0 y = 0 M-1 N-1 Σ Σ *f’(x, y) – f(x, y)]2 x=0 y = 0
  • 20. Fidelity Criteria  Subjective fidelity criteria: • A Decompressed image is presented to a cross section of viewers and averaging their evaluations. • It can be done by using an absolute rating scale Or • By means of side by side comparisons of f(x, y) & f’(x, y). • Side by Side comparison can be done with a scale such as {-3, -2, -1, 0, 1, 2, 3} to represent the subjective valuations {much worse, worse, slightly worse, the same, slightly better, better, much better} respectively.
  • 21. 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.
  • 22. Image Compression Models • Input image f(x,…..) 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,…..) 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.
  • 24. Image Compression Models Encoding or Compression process: Encoder is used to remove the redundancies through a series of 3 independent operations. Mapper: It transforms f(x,…) into a format designed to reduce spatial and temporal redundancies. • It is reversible • It may / may not reduce the amount of data to represent image. Ex. Run Length coding • In video applications, mapper uses previous frames to remove temporal redundancies.
  • 25. Image Compression Models 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.
  • 26. Image Compression Models 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.
  • 27. Image Compression Models Decoding or Decompression process: • Quantization results in irreversible loss, an inverse quantizer block is not included in the decoder block.
  • 28. Some Basic Compression Methods Huffman Coding: • Most popular technique for removing coding redundancies. • It yields smallest possible code symbol per source symbol. Original Source Source reduction Symbol Probability 1 2 3 4 a2 0.4 0.4 0.4 0.4 0.6 a6 0.3 0.3 0.3 0.3 0.4 a1 0.1 0.1 0.2 0.3 a4 0.1 0.1 0.1 a3 0.06 0.1 a5 0.04
  • 29. Some Basic Compression Methods Huffman Coding: Original Source Source reduction Symbol Probability Code 1 2 3 4 a2 0.4 1 0.4 1 0.4 1 0.4 1 0.6 0 a6 0.3 00 0.3 00 0.3 00 0.3 00 0.4 1 a1 0.1 011 0.1 011 0.2 010 0.3 01 a4 0.1 0100 0.1 0100 0.1 011 a3 0.06 01010 0.1 0101 a5 0.04 01011 Lavg = (0.4)(1) + (0.3)(2) + (0.1)(3) + (0.06)(5) +(0.04)(5) = 2.2 bits / pixel.
  • 30. Some Basic Compression Methods Huffman Coding: • It is instantaneous. • Coz each code word in a string of code symbols can be decoded without referencing succeeding symbols. • It is uniquely decodable. • Coz any string of code symbols can be decoded by examining individual symbols of string from left to right. Ex. 010100111100
  • 31. Some Basic Compression Methods Huffman Coding: • It is instantaneous. • Coz each code word in a string of code symbols ca be decoded without referencing succeeding symbols. • It is uniquely decodable. • Coz any string of code symbols can be decoded by examining individual symbols of string from left to right. Ex. 01010 011 1 1 00 First valid code: 01010 – a3, 011 – a1, Thus, completely decoding the message, we get, a3a1a2a2a6
  • 32. Some Basic Compression Methods Arithmetic coding: It generates non block codes. One to One correspondence between source symbols and code words does not exist. Instead, an entire sequence of source symbols is assigned a single arithmetic code. Code word defines an integer of real numbers between 0 & 1. As No. of symbols in msg. interval to represent it no. of bits to represent info Each symbol of msg size of interval in accordance with its probability of occurrence.
  • 33. Some Basic Compression Methods Basic Arithmetic coding process: 5 symbol message, a1a2a3a3a4 from 4 symbol source is coded. Source Symbol Probability Initial Subinterval a1 0.2 [0.0, 0.2) a2 0.2 [0.2, 0.4) a3 0.4 [0.4, 0.8) a4 0.2 [0.8, 1.0)
  • 34. Some Basic Compression Methods Arithmetic coding: a1 a2 a3 a3 a4 1 0.2 0.08 0.072 0.0688 a4 a4 a4 a4 a4 a3 a3 a3 a3 a3 a2 a2 a2 a2 a2 a1 a1 a1 a1 a1 0 0 0.04 0.056 0.0624
  • 35. Some Basic Compression Methods Arithmetic coding: a1 a2 a3 a3 a4 1 0.2 0.08 0.072 0.0688 a4 a4 a4 a4 a4 a3 a3 a3 a3 a3 a2 a2 a2 a2 a2 a1 a1 a1 a1 a1 0 0 0.04 0.056 0.0624
  • 36. Some Basic Compression Methods Arithmetic coding: a1 a2 a3 a3 a4 1 0.2 0.08 0.072 0.0688 a4 a4 a4 a4 a4 a3 a3 a3 a3 a3 a2 a2 a2 a2 a2 a1 a1 a1 a1 a1 0 0 0.04 0.056 0.0624
  • 37. Some Basic Compression Methods Arithmetic coding: a1 a2 a3 a3 a4 1 0.2 0.08 0.072 0.0688 a4 a4 a4 a4 a4 a3 a3 a3 a3 a3 a2 a2 a2 a2 a2 a1 a1 a1 a1 a1 0 0 0.04 0.056 0.0624
  • 38. Some Basic Compression Methods Arithmetic coding: a1 a2 a3 a3 a4 1 0.2 0.08 0.072 0.0688 a4 a4 a4 a4 a4 a3 a3 a3 a3 a3 a2 a2 a2 a2 a2 a1 a1 a1 a1 a1 0 0 0.04 0.056 0.0624
  • 39. Some Basic Compression Methods Arithmetic coding: Encoding Sequence  a1 a2 a3 a3 a4 1 0.2 0.08 0.072 0.0688 a4 a4 a4 a4 a4 a3 a3 a3 a3 a3 a2 a2 a2 a2 a2 a1 a1 a1 a1 a1 0 0 0.04 0.056 0.0624
  • 40. Some Basic Compression Methods The final message symbol narrows to [0.06752, 0.0688). Any number between this interval can be used to represent the message. Eg. 0.068 3 decimal digits are used to represent the 5 symbol message.
  • 41. Some Basic Compression Methods LZW Coding:  LZW – Lempel-Ziv-Welch coding  Error free compression approach that also addresses spatial redundancies in an image.  It assigns fixed-length code words to variable length sequences of source symbols.  It requires no prior knowledge of probability of occurrence of the symbols to be encoded.
  • 42. Some Basic Compression Methods LZW Coding:  It is conceptually very simple.  Initially, a codebook or dictionary containing the source symbols to be coded is constructed.  For an 8-bit BW images, the first 256 words of dictionary are assigned to intensities 0, 1, 2, …., 255.
  • 43. Some Basic Compression Methods LZW Coding: Consider the 4 x 4 8-bit image having a vertical edge. 39 39 126 126 39 39 126 126 39 39 126 126 39 39 126 126 A 512-word dictionary with following content is assumed: - . Dictionary Location Entry 0 0 1 1 . . . . 255 255 256 . 511 -
  • 44. Some Basic Compression Methods Currently Recognized Sequence Pixel Being Processed Encoded Output Dictionary Location Dictionary Entry 39 39 39 39 256 39-39 39 126 39 257 39-126 126 126 126 258 126-126 126 39 126 259 126-39 39 39 39-39 126 256 260 39-39-126 126 126 126-126 39 258 261 126-126-39 39 39 39-39 126 39-39-126 126 260 262 39-39-126-126 126 39 126-39 39 259 263 126-39-39 39 126 39-126 126 257 264 39-126-126 126 126
  • 45. Some Basic Compression Methods Unique feature of LZW coding:  Coding dictionary or code book is created while data are being encoded.
  • 46. Some Basic Compression Methods Bit-plane coding:  Another effective method to reduce interpixel redundancies.  Image’s bit planes are processed individually.  Based on decomposing a multilevel (monochrome / color) image into a series of binary images & compressing each binary using any binary compression method. Bit plane decomposition:  Gray levels of an m-bit gray level image can be represented in form of base 2 polynomial. am-12m-1+am-22m-2+……..+a121+a020 ………(1)
  • 47. Some Basic Compression Methods  A simple method of decomposing the image into a collection of binary image is to separate the m coefficients of the polynomial into m-1 bit planes. Disadvantage:  Small changes in gray level can have significant impact on complexity of bit planes. Ex. If two adjacent pixels have intensity of 127 (01111111) and 128 (10000000), every bit plane will contain a corresponding 0 to 1 (or 1 to 0) transition.
  • 48. Some Basic Compression Methods Alternate decomposition approach:  Reduces the effect of small gray level variations.  Requires the representation of image into m-bit gray code.  m-bit gray code gm-1…..g2g1g0 can be computed from gi = ai xor ai+1 0 ≤ i ≤ m-2 gm-1 = am-1  This code has unique property that successive code words differ by only 1 bit position.  Small changes in gray level are less likely to affect all m bit planes. Ex. 127 (11000000) & 128 (01000000).
  • 49. Some Basic Compression Methods Run-Length Coding:  Standard compression approach used in facsimile (FAX).  Basic concept is to code each contiguous group of 0’s & 1’s encountered in L to R scan of a row by its length & to develop a convention for determining the value of run.  Most common approach for determining the value of run: i) Specify value of first run of each row. ii) Toassume each row begins with a white run whose run length may in fact be zero.
  • 50. Some Basic Compression Methods • Although Run length coding is in itself an effective method of compressing an image, additional compression can be realized by variable-length coding. • Black & white run lengths may be coded separately using variable-length codes. Ex. If aj represent a black run of length j, we can estimate its probability. • The approximate run-length entropy of the image is: HRL = (H0 + H1) / (L0 + L1) • where, L0 & L1 denote average values of black & white run lengths resp. • Above equation also provides an estimate of the average no. of bits per pixel required to code the run lengths in a binary image.
  • 51. Some Basic Compression Methods Lossless predictive coding: • Based on eliminating the interpixel redundancies of closely spaced pixels by extracting & coding only the new information in each pixel. • New information: difference between the actual & predicted value of that pixel.
  • 52. Some Basic Compression Methods •Figure shows basic component of a lossless predictive coding system. •It consists of an encoder & a decoder each containing an identical predictor. •As each successive pixel of input image f(n) is introduced to the encoder, predictor generates its anticipated value. Output of the predictor is then rounded to the nearest integer f(n)bar & used to form the difference or prediction error. e(n) = f(n)– f(n)bar
  • 53. Some Basic Compression Methods • It is coded using a variable length to generate the next element of the compressed data stream. • The decoder reconstruct the fn from the received variable- length code words & perform the inverse operation • f(n) = e(n) + f(n)bar • f(n)bar is generated by prediction formed by a linear combination of m previous pixels. m f(n)bar = round[Σ αi f(n-i)] where, m – order of linear predictori = 1 round – function used to denote rounding αi – for i = 1, 2, 3, ….. m are predictioncoefficients.
  • 54. SOME BASIC COMPRESSION METHODS Lossy Predictive coding:
  • 55. Some Basic Compression Methods Lossy Predictive coding: • In this method we add a quantizer to the lossless predictive coding model. • It replaces the nearest integer function & is placed between symbol encoder & point where prediction error forms. • It maps the prediction error into a limited range of outputs denoted by ë(n), which establish the amount of compression & distortion. • In order to accommodate the insertion of the quantization step, the error free encoder must be altered so that the predictions by the encoder & decoder are equivalent.
  • 56. Some Basic Compression Methods Lossy Predictive coding: • This is accomplished by placing the predictor within a feedback loop, where its input ƒ(n)dot is generated as a function of past predictions & quantized errors. ƒ(n)dot = e(n)dot + f(n)bar • This closed loop configuration prevents error buildup at the decoder’s output.