SlideShare a Scribd company logo
1 of 35
Relative Data Redundancy
0 Let b and b’ denote the number of bits in two representations of the
same information, the relative data redundancy R is
R = 1-1/C
C is called the compression ratio, defined as
C = b/b’
e.g., C = 10, the corresponding relative data redundancy of the larger
representation is 0.9, indicating that 90% of its data is redundant
7/2/2023 2
Why do we need compression?
Data storage
Data transmission
How can we implement compression?
0 Coding redundancy
Most 2-D intensity arrays contain more bits than are
needed to represent the intensities
0 Spatial and temporal redundancy
Pixels of most 2-D intensity arrays are correlated spatially
and video sequences are temporally correlated
0 Irrelevant information
Most 2-D intensity arrays contain information that is
ignored by the human visual system
7/2/2023 3
Examples of Redundancy
7/2/2023 4
Coding Redundancy
7/2/2023 5
1
0
The average number of bits required to represent each pixel is
( ) ( ) 0.25(2) 0.47(1) 0.25(3) 0.03(3) 1.81
L
avg k r k
k
L l r p r bits


     

8
4.42
1.81
1 1/ 4.42 0.774
C
R
 
  
Spatial and Temporal Redundancy
7/2/2023 6
1. All 256 intensities are equally probable.
2. The pixels along each line are identical.
3. The intensity of each line was selected randomly.
Spatial and Temporal Redundancy
7/2/2023 7
1. All 256 intensities are equally probable.
2. The pixels along each line are identical.
3. The intensity of each line was selected randomly.
Run-length pair specifies the start of a new intensity and the
number of consecutive pixels that have that intensity.
Each 256-pixel line of the original representation is replaced
by a single 8-bit intensity value and length 256 in the run-length
representation.
The compression ratio is
256 256 8
128:1
(256 256) 8
 

 
Irrelevant Information
7/2/2023 8
256 256 8/ 8
65536:1
 

Measuring Image Information
7/2/2023 9
A random event E with probability P(E) is said to contain
1
( ) log -log ( )
( )
units of information.
I E P E
P E
 
Measuring Image Information
1 2
1 2
Given a source of statistically independent random events from a
discrete set of possible events { , , ..., } with associated
probabilities { ( ), ( ), ..., ( )}, the average information
per s
J
J
a a a
P a P a P a
1
ource output, called the entropy of the source
- ( )log ( )
is called source symbols. Because they are statistically independent,
the source called .
J
j j
j
j
H P a P a
a
zero memory source




7/2/2023 10
Measuring Image Information
If an image is considered to be the output of an imaginary zero-memory
"intensity source", we can use the histogram of the observed image to
estimate the symbol probabilities of the source. The intensit
1
r r
0
r
y source's
entropy becomes
- ( )log ( )
( ) is the normalized histogram.
L
k k
k
k
H p r p r
p r


 
7/2/2023 11
Measuring Image Information
2 2 2 2
For the fig.8.1(a),
[0.25log 0.25 0.47log 0.47 0.25log 0.25 0.03log 0.03]
1.6614 bits/pixel
H 
   

7/2/2023 12
Fidelity Criteria
1/2
2
1 1
0 0
Let ( , ) be an input image and ( , ) be an approximation
of ( , ). The images are of size .
The - - is
1
( , ) ( , )
M N
rms
x y
f x y f x y
f x y M N
root mean square error
e f x y f x y
MN

  
 

 
 
 
 
 
 
 

7/2/2023 13
Fidelity Criteria
ms
2
1 1
0 0
ms 2
1 1
0 0
The - - - of the output image,
denoted SNR
( , )
SNR
( , ) ( , )
M N
x y
M N
x y
mean square signal to noise ratio
f x y
f x y f x y
  
 
  
 
 
 
 

 

 
 


7/2/2023 14
7/2/2023 15
RMSE = 5.17 RMSE = 15.67 RMSE = 14.17
Image Compression Models
7/2/2023 16
Some Basic Compression Methods:
Huffman Coding
7/2/2023 21
Some Basic Compression Methods:
Huffman Coding
7/2/2023 22
The average length of this code is
0.4*1 0.3*2 0.1*3 0.1*4 0.06*5 0.04*5
= 2.2 bits/pixel
avg
L      
Some Basic Compression Methods:
Golomb Coding
7/2/2023 23
Given a nonnegative integer and a positive integer divisor 0,
the Golomb code of with respect to , denoted ( ), constructed
as follows:
Step 1. Form the unary code of quotient /
(The unary
m
n m
n m G n
n m

 
 
2
code of integer is defined as 1s followed by a 0)
Step2. Let k= log , 2 , mod ,and compute truncated
remainder ' such that
truncated to -1 bits 0
'
trunca
k
q q
m c m r n m
r
r k r c
r
r c
  
 
 
 

 ted to bits otherwise
Step 3. Concatenate the results of steps 1 and 2.
k



Some Basic Compression Methods:
Golomb Coding
7/2/2023 25
2
Step 1. Form the unary code of quotient /
(The unary code of integer is defined as
1s followed by a 0)
Step2. Let k= log , 2 , mod ,
and compute truncated remainder ' such that
k
n m
q
q
m c m r n m
r
r
 
 
  
 
 
truncated to -1 bits 0
'
truncated to bits otherwise
Step 3. Concatenate the results of steps 1 and 2.
r k r c
r c k
 

 


4
2
2
4
(9):
9 / 4 2,
the unary code is 110
k= log 4 2, 2 4 0,
9mod 4 1.
' 01
(9) 11001
G
c
r
r
G

 
 
   
 
 
 


Some Basic Compression Methods:
Golomb Coding
7/2/2023 26
2
Step 1. Form the unary code of quotient /
(The unary code of integer is defined as
1s followed by a 0)
Step2. Let k= log , 2 , mod ,
and compute truncated remainder ' such that
k
n m
q
q
m c m r n m
r
r
 
 
  
 
 
truncated to -1 bits 0
'
truncated to bits otherwise
Step 3. Concatenate the results of steps 1 and 2.
r k r c
r c k
 

 


4 (7)?
G
Some Basic Compression Methods:
Arithmetic Coding
7/2/2023 27
Some Basic Compression Methods:
Arithmetic Coding
7/2/2023 28
How to encode a2a1a2a4?
7/2/2023 29
1.0
0.8
0.4
0.2
0.8
0.72
0.56
0.48
0.4
0.0
0.72
0.688
0.624
0.592
0.592
0.5856
0.5728
0.5664
Therefore, the
message is
a3a3a1a2a4
0.5728
0.57152
056896
0.56768
Decode 0.572. The length of the message is 5.
Since 0.8>code word > 0.4, the first symbol should be a3.
0.56 0.56 0.5664
7/2/2023 30
LZW (Dictionary coding)
LZW (Lempel-Ziv-Welch) coding, assigns fixed-length code
words to variable length sequences of source symbols, but
requires no a priori knowledge of the probability of the source
symbols.
LZW is used in:
•Tagged Image file format (TIFF)
•Graphic interchange format (GIF)
•Portable document format (PDF)
LZW was formulated in 1984
7/2/2023 31
The Algorithm:
•A codebook or “dictionary” containing the source
symbols is constructed.
•For 8-bit monochrome images, the first 256 words of
the dictionary are assigned to the gray levels 0-255
•Remaining part of the dictionary is filled with
sequences of the gray levels
7/2/2023 32
Important features of LZW
1. The dictionary is created while the data are being
encoded. So encoding can be done “on the fly”
2. The dictionary is not required to be transmitted. The
dictionary will be built up in the decoding
3. If the dictionary “overflows” then we have to reinitialize
the dictionary and add a bit to each one of the code words.
4. Choosing a large dictionary size avoids overflow, but
spoils compressions
7/2/2023 33
Example:
39 39 126 126
39 39 126 126
39 39 126 126
39 39 126 126
7/2/2023 34
7/2/2023 35
126
126
126
7/2/2023 36
Let the bit stream received be:
39 39 126 126 256 258 260 259 257 126
In LZW, the dictionary which was used for encoding
need not be sent with the image. A separate dictionary
is built by the decoder, on the “fly”, as it reads the
received code words.
Decoding LZW
7/2/2023 37
Recognized Encoded
value
pixels Dic. address Dic. entry
39 39
39 39 39 256 39-39
39 126 126 257 39-126
126 126 126 258 126-126
126 256 39-39 259 126-39
256 258 126-126 260 39-39-126
258 260 39-39-126 261 126-126-39
260 259 126-39 262
39-39-126-
126
259 257 39-126 263 126-39-39
257 126 126 264 39-126-126
Some Basic Compression Methods:
Run-Length Coding
7/2/2023 38
1. Run-length Encoding, or RLE is a technique used to reduce
the size of a repeating string of characters.
2. This repeating string is called a run, typically RLE encodes a
run of symbols into two bytes , a count and a symbol.
3. RLE can compress any type of data
4. RLE cannot achieve high compression ratios compared to
other compression methods
Some Basic Compression Methods:
Run-Length Coding
7/2/2023 39
5. It is easy to implement and is quick to execute.
6. Run-length encoding is supported by most bitmap file formats
such as TIFF, BMP and PCX
Some Basic Compression Methods:
Run-Length Coding
7/2/2023 40
WWWWWWWWWWWWBWWWWWWWWWWWWBBBW
WWWWWWWWWWWWWWWWWWWWWWWBWWWW
WWWWWWWWWW
RLE coding:
12W1B12W3B24W1B14W

More Related Content

Similar to Image compression1.ppt

f33-ft-computing-lec09-correct.ppt
f33-ft-computing-lec09-correct.pptf33-ft-computing-lec09-correct.ppt
f33-ft-computing-lec09-correct.pptMaddulaCharishma
 
FPGA Implementation of Soft Output Viterbi Algorithm Using Memoryless Hybrid ...
FPGA Implementation of Soft Output Viterbi Algorithm Using Memoryless Hybrid ...FPGA Implementation of Soft Output Viterbi Algorithm Using Memoryless Hybrid ...
FPGA Implementation of Soft Output Viterbi Algorithm Using Memoryless Hybrid ...VLSICS Design
 
Image compression 14_04_2020 (1)
Image compression 14_04_2020 (1)Image compression 14_04_2020 (1)
Image compression 14_04_2020 (1)Joel P
 
Reed solomon explained v1 0
Reed solomon explained v1 0Reed solomon explained v1 0
Reed solomon explained v1 0Simona Grigoras
 
cp467_12_lecture14_image compression1.pdf
cp467_12_lecture14_image compression1.pdfcp467_12_lecture14_image compression1.pdf
cp467_12_lecture14_image compression1.pdfshaikmoosa2003
 
EFFICIENT MULTIPLIERS FOR 1-OUT-OF-3 BINARY SIGNED-DIGIT NUMBER SYSTEM
EFFICIENT MULTIPLIERS FOR 1-OUT-OF-3 BINARY SIGNED-DIGIT NUMBER SYSTEMEFFICIENT MULTIPLIERS FOR 1-OUT-OF-3 BINARY SIGNED-DIGIT NUMBER SYSTEM
EFFICIENT MULTIPLIERS FOR 1-OUT-OF-3 BINARY SIGNED-DIGIT NUMBER SYSTEMelelijjournal
 
Modified Golomb Code For Integer Representation
Modified Golomb Code For Integer RepresentationModified Golomb Code For Integer Representation
Modified Golomb Code For Integer RepresentationIJSRD
 
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
 
The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)theijes
 
Decoding of the extended Golay code by the simplified successive-cancellation...
Decoding of the extended Golay code by the simplified successive-cancellation...Decoding of the extended Golay code by the simplified successive-cancellation...
Decoding of the extended Golay code by the simplified successive-cancellation...TELKOMNIKA JOURNAL
 
image compression in data compression
image compression in data compressionimage compression in data compression
image compression in data compressionZaabir Ali
 
Multimedia image compression standards
Multimedia image compression standardsMultimedia image compression standards
Multimedia image compression standardsMazin Alwaaly
 
ANALYSIS & DESIGN OF COMBINATIONAL LOGIC
ANALYSIS & DESIGN OF COMBINATIONAL LOGICANALYSIS & DESIGN OF COMBINATIONAL LOGIC
ANALYSIS & DESIGN OF COMBINATIONAL LOGICSupanna Shirguppe
 
Performance analysis of viterbi decoder for wireless applications
Performance analysis of viterbi decoder for wireless applicationsPerformance analysis of viterbi decoder for wireless applications
Performance analysis of viterbi decoder for wireless applicationsacijjournal
 
Developing digital signal clustering method using local binary pattern histog...
Developing digital signal clustering method using local binary pattern histog...Developing digital signal clustering method using local binary pattern histog...
Developing digital signal clustering method using local binary pattern histog...IJECEIAES
 

Similar to Image compression1.ppt (20)

f33-ft-computing-lec09-correct.ppt
f33-ft-computing-lec09-correct.pptf33-ft-computing-lec09-correct.ppt
f33-ft-computing-lec09-correct.ppt
 
FPGA Implementation of Soft Output Viterbi Algorithm Using Memoryless Hybrid ...
FPGA Implementation of Soft Output Viterbi Algorithm Using Memoryless Hybrid ...FPGA Implementation of Soft Output Viterbi Algorithm Using Memoryless Hybrid ...
FPGA Implementation of Soft Output Viterbi Algorithm Using Memoryless Hybrid ...
 
Compression Ii
Compression IiCompression Ii
Compression Ii
 
Compression Ii
Compression IiCompression Ii
Compression Ii
 
Image compression 14_04_2020 (1)
Image compression 14_04_2020 (1)Image compression 14_04_2020 (1)
Image compression 14_04_2020 (1)
 
Reed solomon explained v1 0
Reed solomon explained v1 0Reed solomon explained v1 0
Reed solomon explained v1 0
 
cp467_12_lecture14_image compression1.pdf
cp467_12_lecture14_image compression1.pdfcp467_12_lecture14_image compression1.pdf
cp467_12_lecture14_image compression1.pdf
 
EFFICIENT MULTIPLIERS FOR 1-OUT-OF-3 BINARY SIGNED-DIGIT NUMBER SYSTEM
EFFICIENT MULTIPLIERS FOR 1-OUT-OF-3 BINARY SIGNED-DIGIT NUMBER SYSTEMEFFICIENT MULTIPLIERS FOR 1-OUT-OF-3 BINARY SIGNED-DIGIT NUMBER SYSTEM
EFFICIENT MULTIPLIERS FOR 1-OUT-OF-3 BINARY SIGNED-DIGIT NUMBER SYSTEM
 
Modified Golomb Code For Integer Representation
Modified Golomb Code For Integer RepresentationModified Golomb Code For Integer Representation
Modified Golomb Code For Integer Representation
 
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
 
The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)
 
Decoding of the extended Golay code by the simplified successive-cancellation...
Decoding of the extended Golay code by the simplified successive-cancellation...Decoding of the extended Golay code by the simplified successive-cancellation...
Decoding of the extended Golay code by the simplified successive-cancellation...
 
image compression in data compression
image compression in data compressionimage compression in data compression
image compression in data compression
 
Bt32444450
Bt32444450Bt32444450
Bt32444450
 
Multimedia image compression standards
Multimedia image compression standardsMultimedia image compression standards
Multimedia image compression standards
 
Image compression
Image compressionImage compression
Image compression
 
BCDCONVERTER.pptx
BCDCONVERTER.pptxBCDCONVERTER.pptx
BCDCONVERTER.pptx
 
ANALYSIS & DESIGN OF COMBINATIONAL LOGIC
ANALYSIS & DESIGN OF COMBINATIONAL LOGICANALYSIS & DESIGN OF COMBINATIONAL LOGIC
ANALYSIS & DESIGN OF COMBINATIONAL LOGIC
 
Performance analysis of viterbi decoder for wireless applications
Performance analysis of viterbi decoder for wireless applicationsPerformance analysis of viterbi decoder for wireless applications
Performance analysis of viterbi decoder for wireless applications
 
Developing digital signal clustering method using local binary pattern histog...
Developing digital signal clustering method using local binary pattern histog...Developing digital signal clustering method using local binary pattern histog...
Developing digital signal clustering method using local binary pattern histog...
 

Recently uploaded

IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 

Recently uploaded (20)

IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 

Image compression1.ppt

  • 1.
  • 2. Relative Data Redundancy 0 Let b and b’ denote the number of bits in two representations of the same information, the relative data redundancy R is R = 1-1/C C is called the compression ratio, defined as C = b/b’ e.g., C = 10, the corresponding relative data redundancy of the larger representation is 0.9, indicating that 90% of its data is redundant 7/2/2023 2 Why do we need compression? Data storage Data transmission
  • 3. How can we implement compression? 0 Coding redundancy Most 2-D intensity arrays contain more bits than are needed to represent the intensities 0 Spatial and temporal redundancy Pixels of most 2-D intensity arrays are correlated spatially and video sequences are temporally correlated 0 Irrelevant information Most 2-D intensity arrays contain information that is ignored by the human visual system 7/2/2023 3
  • 5. Coding Redundancy 7/2/2023 5 1 0 The average number of bits required to represent each pixel is ( ) ( ) 0.25(2) 0.47(1) 0.25(3) 0.03(3) 1.81 L avg k r k k L l r p r bits          8 4.42 1.81 1 1/ 4.42 0.774 C R     
  • 6. Spatial and Temporal Redundancy 7/2/2023 6 1. All 256 intensities are equally probable. 2. The pixels along each line are identical. 3. The intensity of each line was selected randomly.
  • 7. Spatial and Temporal Redundancy 7/2/2023 7 1. All 256 intensities are equally probable. 2. The pixels along each line are identical. 3. The intensity of each line was selected randomly. Run-length pair specifies the start of a new intensity and the number of consecutive pixels that have that intensity. Each 256-pixel line of the original representation is replaced by a single 8-bit intensity value and length 256 in the run-length representation. The compression ratio is 256 256 8 128:1 (256 256) 8     
  • 8. Irrelevant Information 7/2/2023 8 256 256 8/ 8 65536:1   
  • 9. Measuring Image Information 7/2/2023 9 A random event E with probability P(E) is said to contain 1 ( ) log -log ( ) ( ) units of information. I E P E P E  
  • 10. Measuring Image Information 1 2 1 2 Given a source of statistically independent random events from a discrete set of possible events { , , ..., } with associated probabilities { ( ), ( ), ..., ( )}, the average information per s J J a a a P a P a P a 1 ource output, called the entropy of the source - ( )log ( ) is called source symbols. Because they are statistically independent, the source called . J j j j j H P a P a a zero memory source     7/2/2023 10
  • 11. Measuring Image Information If an image is considered to be the output of an imaginary zero-memory "intensity source", we can use the histogram of the observed image to estimate the symbol probabilities of the source. The intensit 1 r r 0 r y source's entropy becomes - ( )log ( ) ( ) is the normalized histogram. L k k k k H p r p r p r     7/2/2023 11
  • 12. Measuring Image Information 2 2 2 2 For the fig.8.1(a), [0.25log 0.25 0.47log 0.47 0.25log 0.25 0.03log 0.03] 1.6614 bits/pixel H       7/2/2023 12
  • 13. Fidelity Criteria 1/2 2 1 1 0 0 Let ( , ) be an input image and ( , ) be an approximation of ( , ). The images are of size . The - - is 1 ( , ) ( , ) M N rms x y f x y f x y f x y M N root mean square error e f x y f x y MN                       7/2/2023 13
  • 14. Fidelity Criteria ms 2 1 1 0 0 ms 2 1 1 0 0 The - - - of the output image, denoted SNR ( , ) SNR ( , ) ( , ) M N x y M N x y mean square signal to noise ratio f x y f x y f x y                           7/2/2023 14
  • 15. 7/2/2023 15 RMSE = 5.17 RMSE = 15.67 RMSE = 14.17
  • 17. Some Basic Compression Methods: Huffman Coding 7/2/2023 21
  • 18. Some Basic Compression Methods: Huffman Coding 7/2/2023 22 The average length of this code is 0.4*1 0.3*2 0.1*3 0.1*4 0.06*5 0.04*5 = 2.2 bits/pixel avg L      
  • 19. Some Basic Compression Methods: Golomb Coding 7/2/2023 23 Given a nonnegative integer and a positive integer divisor 0, the Golomb code of with respect to , denoted ( ), constructed as follows: Step 1. Form the unary code of quotient / (The unary m n m n m G n n m      2 code of integer is defined as 1s followed by a 0) Step2. Let k= log , 2 , mod ,and compute truncated remainder ' such that truncated to -1 bits 0 ' trunca k q q m c m r n m r r k r c r r c            ted to bits otherwise Step 3. Concatenate the results of steps 1 and 2. k   
  • 20. Some Basic Compression Methods: Golomb Coding 7/2/2023 25 2 Step 1. Form the unary code of quotient / (The unary code of integer is defined as 1s followed by a 0) Step2. Let k= log , 2 , mod , and compute truncated remainder ' such that k n m q q m c m r n m r r            truncated to -1 bits 0 ' truncated to bits otherwise Step 3. Concatenate the results of steps 1 and 2. r k r c r c k        4 2 2 4 (9): 9 / 4 2, the unary code is 110 k= log 4 2, 2 4 0, 9mod 4 1. ' 01 (9) 11001 G c r r G                 
  • 21. Some Basic Compression Methods: Golomb Coding 7/2/2023 26 2 Step 1. Form the unary code of quotient / (The unary code of integer is defined as 1s followed by a 0) Step2. Let k= log , 2 , mod , and compute truncated remainder ' such that k n m q q m c m r n m r r            truncated to -1 bits 0 ' truncated to bits otherwise Step 3. Concatenate the results of steps 1 and 2. r k r c r c k        4 (7)? G
  • 22. Some Basic Compression Methods: Arithmetic Coding 7/2/2023 27
  • 23. Some Basic Compression Methods: Arithmetic Coding 7/2/2023 28 How to encode a2a1a2a4?
  • 24. 7/2/2023 29 1.0 0.8 0.4 0.2 0.8 0.72 0.56 0.48 0.4 0.0 0.72 0.688 0.624 0.592 0.592 0.5856 0.5728 0.5664 Therefore, the message is a3a3a1a2a4 0.5728 0.57152 056896 0.56768 Decode 0.572. The length of the message is 5. Since 0.8>code word > 0.4, the first symbol should be a3. 0.56 0.56 0.5664
  • 25. 7/2/2023 30 LZW (Dictionary coding) LZW (Lempel-Ziv-Welch) coding, assigns fixed-length code words to variable length sequences of source symbols, but requires no a priori knowledge of the probability of the source symbols. LZW is used in: •Tagged Image file format (TIFF) •Graphic interchange format (GIF) •Portable document format (PDF) LZW was formulated in 1984
  • 26. 7/2/2023 31 The Algorithm: •A codebook or “dictionary” containing the source symbols is constructed. •For 8-bit monochrome images, the first 256 words of the dictionary are assigned to the gray levels 0-255 •Remaining part of the dictionary is filled with sequences of the gray levels
  • 27. 7/2/2023 32 Important features of LZW 1. The dictionary is created while the data are being encoded. So encoding can be done “on the fly” 2. The dictionary is not required to be transmitted. The dictionary will be built up in the decoding 3. If the dictionary “overflows” then we have to reinitialize the dictionary and add a bit to each one of the code words. 4. Choosing a large dictionary size avoids overflow, but spoils compressions
  • 28. 7/2/2023 33 Example: 39 39 126 126 39 39 126 126 39 39 126 126 39 39 126 126
  • 31. 7/2/2023 36 Let the bit stream received be: 39 39 126 126 256 258 260 259 257 126 In LZW, the dictionary which was used for encoding need not be sent with the image. A separate dictionary is built by the decoder, on the “fly”, as it reads the received code words. Decoding LZW
  • 32. 7/2/2023 37 Recognized Encoded value pixels Dic. address Dic. entry 39 39 39 39 39 256 39-39 39 126 126 257 39-126 126 126 126 258 126-126 126 256 39-39 259 126-39 256 258 126-126 260 39-39-126 258 260 39-39-126 261 126-126-39 260 259 126-39 262 39-39-126- 126 259 257 39-126 263 126-39-39 257 126 126 264 39-126-126
  • 33. Some Basic Compression Methods: Run-Length Coding 7/2/2023 38 1. Run-length Encoding, or RLE is a technique used to reduce the size of a repeating string of characters. 2. This repeating string is called a run, typically RLE encodes a run of symbols into two bytes , a count and a symbol. 3. RLE can compress any type of data 4. RLE cannot achieve high compression ratios compared to other compression methods
  • 34. Some Basic Compression Methods: Run-Length Coding 7/2/2023 39 5. It is easy to implement and is quick to execute. 6. Run-length encoding is supported by most bitmap file formats such as TIFF, BMP and PCX
  • 35. Some Basic Compression Methods: Run-Length Coding 7/2/2023 40 WWWWWWWWWWWWBWWWWWWWWWWWWBBBW WWWWWWWWWWWWWWWWWWWWWWWBWWWW WWWWWWWWWW RLE coding: 12W1B12W3B24W1B14W