SlideShare a Scribd company logo
Huffman Coding, Bit plane coding
and arithmetic coding
Dr. r.sudarmani, associate professor/ece
MERISH S A, III ECE
Avinashilingam institute
TOPIC 1: VARIABLE LENGTH CODING
 Variable length coding method is used to minimize the coding
redundancy.
 Variable-length coding reduces only coding redundancy by
assigning the shortest possible code words to the most probable
(grey) levels.
 The most popular variable length coding is “Huffman coding
method”.
Codes:
It is a group of bits.
Types of codes:
i. Fixed length code
ii. Variable length code
FIXED LENGTH CODE:
Each code word uses the same number of bits.
VARIABLE LENGTH CODE:
Each code word uses different number of bits.
Eg: Assign A= 000; B=000 which is fixed length code
Assign A=00; B=100 which is variable length code
HUFFMAN CODING METHOD:
It is also known as minimum redundancy method.
(ie) it leads to the lowest possible value of 1 for given m.
There are three procedure for obtaining Huffman coding, they are
 list the source symbols in order of decreasing probability.
 Combine the probabilities of the two symbols having the lowest probabilities and
reorder the resultant probabilities. This step is called reduction.
 The same procedure is repeated until there are two ordered probabilities
remaining
EXAMPLE:
CALCULATE THE HUFFMAN CODES FOR THE
SET OF SYMBOLS AS SHOWN IN TABLE
SYMBOLS A B C D
PROBABILITY 0.4 0.3 0.2 0.1
Digital image processing- Compression- Different Coding techniques
Digital image processing- Compression- Different Coding techniques
EXAMPLE 2:
A source has 6 symbols a1,a2,a3,a4,a5,a6 with probabilities
0.1,0.4,0.06,0.1,0.04.0.3 respectively attached to every symbol.
construct Huffman code for the source and calculate the
codeword.
Digital image processing- Compression- Different Coding techniques
Digital image processing- Compression- Different Coding techniques
REFERENCE:
https://www.youtube.com/watch?v=FfiDvZnlKZI
https://www.youtube.com/watch?v=oxVauLakNcY
TOPIC 2: BIT PLANE CODING
Bit-plane coding has been widely used in lossless compression of gray-scale images or
color palette images and Bit plane coding technique is an effective approach to provide
bitstream truncation ability.
It splits a multilevel image into a series of bit level image.
The gray levels of an m-bit gray-scale image can be represented in the form of the base
2 polynomial
We can generate three bit plane are;
 The Zero’th bit plane is generated by collecting the a0
bits of each pixels.
 The first order bit plane is generated by collecting the
all bits of each pixel.
 The m-1 order bit plane is generated by collecting the
m-1 bits of each pixel
EXAMPLE :
In given grey scale image apply bit plane coding.
A =
2 6 6
6 7 7
1 2 4
STEP 1: Write the given input in binary equivalent code
A= 010 111 110
110 111 111
001 010 100
STEP 2: A can be divided into three planes,
By using MSB
By using middle bits
By using LSB
0 1 1 0 0 1
A(msb)= 1 1 1 a(lsb)= 0 1 1
0 0 1 1 0 0
A(middle) = 1 1 1
1 1 1
0 1 0
The disadvantages of this type is that neighbourhood in the spatial domain like
3 and 4 have binary code 011 and 100 are not present together in any plane.
To avoid this problem grey codes can be used instead of binary codes
In grey codes, successive codes differ by only one bit.
• Here, the exclusive OR operation is done . This code has the unique property
that successive code words differ in only one bit position.
• Thus, small changes in gray level are less likely to affect all m bit planes.
• For instance, when gray levels 127 and 128 are adjacent, only the 7th bit plane
will contain a 0 to 1 transition, because the Gray codes that correspond to 127
and 128 are 11000000 and 01000000, respectively.
Digital image processing- Compression- Different Coding techniques
Reference:
https://www.youtube.com/watch?v=7_AolrMtWYk&t=5s
https://www.imageeprocessing.com/2015/10/bit-plane-
compression.html
http://vemu.org/uploads/lecture_notes/30_12_2019_616360124.pdf
ARITHMETIC CODING
 Arithmetic coding is a popular compression algorithm after
Huffman coding and it is particularly useful for a relatively
small and skewed alphabet.
 It is also one of the types of lossless compression algorithm.
 arithmetic coding algorithm encodes an entire file as a sequence
of symbols into a single decimal number.
 The initial interval [0, 1) (or [0, 1]) is successively divided into subintervals
on each iteration according to the probability distribution.
 The subinterval that corresponds to the input symbol is selected for next
iteration.
 The interval derived at the end of this division process is used to decide
the codeword for the entire sequence of symbols.
PROCEDURE FOR ARITHMETIC CODING:
Step 1: divide the numeric range 0 to 1 into number of different symbol
present in the messages.
Step 2: expand the first letter to be coded along with the range .further
subdivide this range into number of symbols.
Step 3: repeat the procedure until termination character is coded.
EXAMPLE:
Code the string CAB using arithmetic coding.
Character A B C
probability 0.6 0.3 0.1
Digital image processing- Compression- Different Coding techniques
Digital image processing- Compression- Different Coding techniques
Digital image processing- Compression- Different Coding techniques
Digital image processing- Compression- Different Coding techniques
Digital image processing- Compression- Different Coding techniques
Digital image processing- Compression- Different Coding techniques
EXAMPLE:
Consider the transmission of the message “went.” comprising a string
of characters with probabilities e=0.3, n=0.3, t=0.2, w=0.1, .=0.1
Here the arithmetic codeword range is 0.81602 to 0.8162
DIFFERENCE BETWEEN ARITHMETIC CODING AND HUFFMAN CODING
ARITHMETICCODING HUFFMANCODING
Complex technique for coding short
messages
Simple techniques
Gives optimum results Does not give optimum results
There is no one to one correspondence
between source symbol and codeword
There is one to one correspondence
between source symbol and codeword
Compression ratio is more Compression ratio is less
Execution time is more Execution time is less
applications
 Arithmetic coding is used in a variety of lossless and
lossy compression applications.
 It is a part of many international standards.
 arithmetic coding is used in image compression, audio
compression, and video compression standards.
REFERENCE:
https://youtu.be/SNvY3_FEBCM
https://youtu.be/4yYgRAHtDLk
THANK YOU

More Related Content

What's hot (20)

PPTX
Fundamentals and image compression models
lavanya marichamy
 
PPSX
Edge Detection and Segmentation
Dr. A. B. Shinde
 
PDF
Image Restoration (Digital Image Processing)
Kalyan Acharjya
 
PPTX
Psuedo color
Mariashoukat1206
 
PPT
Arithmetic coding
Vikas Goyal
 
PPTX
Image restoration and degradation model
AnupriyaDurai
 
PPTX
Homomorphic filtering
Gautam Saxena
 
PDF
Digital Image Processing - Image Compression
Mathankumar S
 
PPT
Sharpening using frequency Domain Filter
arulraj121
 
PPTX
Image compression models
priyadharshini murugan
 
PPT
Image segmentation
Md Shabir Alam
 
PPTX
Image transforms
11mr11mahesh
 
PPTX
Wavelet based image compression technique
Priyanka Pachori
 
PPTX
Image compression .
Payal Vishwakarma
 
PPTX
Image Enhancement in Spatial Domain
DEEPASHRI HK
 
PPTX
Chapter 8 image compression
asodariyabhavesh
 
PDF
Error Control Coding -Introduction
Burdwan University
 
PPTX
Lossless predictive coding in Digital Image Processing
priyadharshini murugan
 
PPTX
Chapter 3 image enhancement (spatial domain)
asodariyabhavesh
 
PDF
Digital Image Processing: Image Segmentation
Mostafa G. M. Mostafa
 
Fundamentals and image compression models
lavanya marichamy
 
Edge Detection and Segmentation
Dr. A. B. Shinde
 
Image Restoration (Digital Image Processing)
Kalyan Acharjya
 
Psuedo color
Mariashoukat1206
 
Arithmetic coding
Vikas Goyal
 
Image restoration and degradation model
AnupriyaDurai
 
Homomorphic filtering
Gautam Saxena
 
Digital Image Processing - Image Compression
Mathankumar S
 
Sharpening using frequency Domain Filter
arulraj121
 
Image compression models
priyadharshini murugan
 
Image segmentation
Md Shabir Alam
 
Image transforms
11mr11mahesh
 
Wavelet based image compression technique
Priyanka Pachori
 
Image compression .
Payal Vishwakarma
 
Image Enhancement in Spatial Domain
DEEPASHRI HK
 
Chapter 8 image compression
asodariyabhavesh
 
Error Control Coding -Introduction
Burdwan University
 
Lossless predictive coding in Digital Image Processing
priyadharshini murugan
 
Chapter 3 image enhancement (spatial domain)
asodariyabhavesh
 
Digital Image Processing: Image Segmentation
Mostafa G. M. Mostafa
 

Similar to Digital image processing- Compression- Different Coding techniques (20)

PDF
Arithmetic coding
Gidey Leul
 
PPT
Compression ii
Chandra Mohan Negi
 
PPT
Compression Ii
anithabalaprabhu
 
PPT
Compression Ii
anithabalaprabhu
 
PDF
Introduction to Source Coding.pdf
Jimma University
 
PPTX
arithmetic coding for signal and multimedia processing
Karansingh415757
 
PDF
Huffman and Arithmetic coding - Performance analysis
Ramakant Soni
 
PDF
Unit 3 Arithmetic Coding
Dr Piyush Charan
 
PPT
Huffman Coding
anithabalaprabhu
 
PPT
Lec7 8 9_10 coding techniques
Dom Mike
 
PPT
Huffman coding
George Ang
 
DOCX
Arithmetic coding
09lavee
 
PPT
Lossless
anithabalaprabhu
 
PPT
Lossless
Vishal Suri
 
PDF
first_assignment_Report
Anıl Ulaş KOÇAK
 
PDF
Implementation of Lossless Compression Algorithms for Text Data
BRNSSPublicationHubI
 
PPT
2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...
Helan4
 
PPT
Huffman&Shannon-multimedia algorithms.ppt
PrincessSaro
 
PDF
Sunzip user tool for data reduction using huffman algorithm
Dr Sandeep Kumar Poonia
 
Arithmetic coding
Gidey Leul
 
Compression ii
Chandra Mohan Negi
 
Compression Ii
anithabalaprabhu
 
Compression Ii
anithabalaprabhu
 
Introduction to Source Coding.pdf
Jimma University
 
arithmetic coding for signal and multimedia processing
Karansingh415757
 
Huffman and Arithmetic coding - Performance analysis
Ramakant Soni
 
Unit 3 Arithmetic Coding
Dr Piyush Charan
 
Huffman Coding
anithabalaprabhu
 
Lec7 8 9_10 coding techniques
Dom Mike
 
Huffman coding
George Ang
 
Arithmetic coding
09lavee
 
Lossless
Vishal Suri
 
first_assignment_Report
Anıl Ulaş KOÇAK
 
Implementation of Lossless Compression Algorithms for Text Data
BRNSSPublicationHubI
 
2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...
Helan4
 
Huffman&Shannon-multimedia algorithms.ppt
PrincessSaro
 
Sunzip user tool for data reduction using huffman algorithm
Dr Sandeep Kumar Poonia
 
Ad

More from sudarmani rajagopal (8)

PPT
Machine Learning and its Appplications--
sudarmani rajagopal
 
PPTX
Intro to raspberry pi
sudarmani rajagopal
 
PPTX
What is Artificial intelligence
sudarmani rajagopal
 
PPT
Role of DSP in Biometric Applications
sudarmani rajagopal
 
PPT
Digital Electronics
sudarmani rajagopal
 
PPT
Number systems ppt
sudarmani rajagopal
 
PPTX
E waste
sudarmani rajagopal
 
PPT
Introduction to signals and systems
sudarmani rajagopal
 
Machine Learning and its Appplications--
sudarmani rajagopal
 
Intro to raspberry pi
sudarmani rajagopal
 
What is Artificial intelligence
sudarmani rajagopal
 
Role of DSP in Biometric Applications
sudarmani rajagopal
 
Digital Electronics
sudarmani rajagopal
 
Number systems ppt
sudarmani rajagopal
 
Introduction to signals and systems
sudarmani rajagopal
 
Ad

Recently uploaded (20)

PPTX
Practical Applications of AI in Local Government
OnBoard
 
PDF
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
 
PDF
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
yosra Saidani
 
PDF
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
 
PDF
FME as an Orchestration Tool with Principles From Data Gravity
Safe Software
 
PDF
2025_06_18 - OpenMetadata Community Meeting.pdf
OpenMetadata
 
PDF
Hello I'm "AI" Your New _________________
Dr. Tathagat Varma
 
PDF
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
 
PDF
Redefining Work in the Age of AI - What to expect? How to prepare? Why it mat...
Malinda Kapuruge
 
PPSX
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
PPTX
𝙳𝚘𝚠𝚗𝚕𝚘𝚊𝚍—Wondershare Filmora Crack 14.0.7 + Key Download 2025
sebastian aliya
 
PDF
Database Benchmarking for Performance Masterclass: Session 1 - Benchmarking F...
ScyllaDB
 
PDF
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
 
PPTX
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
 
PPTX
UserCon Belgium: Honey, VMware increased my bill
stijn40
 
PDF
How to Visualize the ​Spatio-Temporal Data Using CesiumJS​
SANGHEE SHIN
 
PDF
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
ScyllaDB
 
PDF
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
PDF
Optimizing the trajectory of a wheel loader working in short loading cycles
Reno Filla
 
Practical Applications of AI in Local Government
OnBoard
 
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
 
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
yosra Saidani
 
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
 
FME as an Orchestration Tool with Principles From Data Gravity
Safe Software
 
2025_06_18 - OpenMetadata Community Meeting.pdf
OpenMetadata
 
Hello I'm "AI" Your New _________________
Dr. Tathagat Varma
 
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
 
Redefining Work in the Age of AI - What to expect? How to prepare? Why it mat...
Malinda Kapuruge
 
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
𝙳𝚘𝚠𝚗𝚕𝚘𝚊𝚍—Wondershare Filmora Crack 14.0.7 + Key Download 2025
sebastian aliya
 
Database Benchmarking for Performance Masterclass: Session 1 - Benchmarking F...
ScyllaDB
 
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
 
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
 
UserCon Belgium: Honey, VMware increased my bill
stijn40
 
How to Visualize the ​Spatio-Temporal Data Using CesiumJS​
SANGHEE SHIN
 
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
ScyllaDB
 
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
Optimizing the trajectory of a wheel loader working in short loading cycles
Reno Filla
 

Digital image processing- Compression- Different Coding techniques

  • 1. Huffman Coding, Bit plane coding and arithmetic coding Dr. r.sudarmani, associate professor/ece MERISH S A, III ECE Avinashilingam institute
  • 2. TOPIC 1: VARIABLE LENGTH CODING  Variable length coding method is used to minimize the coding redundancy.  Variable-length coding reduces only coding redundancy by assigning the shortest possible code words to the most probable (grey) levels.  The most popular variable length coding is “Huffman coding method”.
  • 3. Codes: It is a group of bits. Types of codes: i. Fixed length code ii. Variable length code FIXED LENGTH CODE: Each code word uses the same number of bits. VARIABLE LENGTH CODE: Each code word uses different number of bits. Eg: Assign A= 000; B=000 which is fixed length code Assign A=00; B=100 which is variable length code
  • 4. HUFFMAN CODING METHOD: It is also known as minimum redundancy method. (ie) it leads to the lowest possible value of 1 for given m. There are three procedure for obtaining Huffman coding, they are  list the source symbols in order of decreasing probability.  Combine the probabilities of the two symbols having the lowest probabilities and reorder the resultant probabilities. This step is called reduction.  The same procedure is repeated until there are two ordered probabilities remaining
  • 5. EXAMPLE: CALCULATE THE HUFFMAN CODES FOR THE SET OF SYMBOLS AS SHOWN IN TABLE SYMBOLS A B C D PROBABILITY 0.4 0.3 0.2 0.1
  • 8. EXAMPLE 2: A source has 6 symbols a1,a2,a3,a4,a5,a6 with probabilities 0.1,0.4,0.06,0.1,0.04.0.3 respectively attached to every symbol. construct Huffman code for the source and calculate the codeword.
  • 12. TOPIC 2: BIT PLANE CODING Bit-plane coding has been widely used in lossless compression of gray-scale images or color palette images and Bit plane coding technique is an effective approach to provide bitstream truncation ability. It splits a multilevel image into a series of bit level image. The gray levels of an m-bit gray-scale image can be represented in the form of the base 2 polynomial
  • 13. We can generate three bit plane are;  The Zero’th bit plane is generated by collecting the a0 bits of each pixels.  The first order bit plane is generated by collecting the all bits of each pixel.  The m-1 order bit plane is generated by collecting the m-1 bits of each pixel
  • 14. EXAMPLE : In given grey scale image apply bit plane coding. A = 2 6 6 6 7 7 1 2 4
  • 15. STEP 1: Write the given input in binary equivalent code A= 010 111 110 110 111 111 001 010 100
  • 16. STEP 2: A can be divided into three planes, By using MSB By using middle bits By using LSB 0 1 1 0 0 1 A(msb)= 1 1 1 a(lsb)= 0 1 1 0 0 1 1 0 0 A(middle) = 1 1 1 1 1 1 0 1 0
  • 17. The disadvantages of this type is that neighbourhood in the spatial domain like 3 and 4 have binary code 011 and 100 are not present together in any plane. To avoid this problem grey codes can be used instead of binary codes In grey codes, successive codes differ by only one bit.
  • 18. • Here, the exclusive OR operation is done . This code has the unique property that successive code words differ in only one bit position. • Thus, small changes in gray level are less likely to affect all m bit planes. • For instance, when gray levels 127 and 128 are adjacent, only the 7th bit plane will contain a 0 to 1 transition, because the Gray codes that correspond to 127 and 128 are 11000000 and 01000000, respectively.
  • 21. ARITHMETIC CODING  Arithmetic coding is a popular compression algorithm after Huffman coding and it is particularly useful for a relatively small and skewed alphabet.  It is also one of the types of lossless compression algorithm.  arithmetic coding algorithm encodes an entire file as a sequence of symbols into a single decimal number.
  • 22.  The initial interval [0, 1) (or [0, 1]) is successively divided into subintervals on each iteration according to the probability distribution.  The subinterval that corresponds to the input symbol is selected for next iteration.  The interval derived at the end of this division process is used to decide the codeword for the entire sequence of symbols.
  • 23. PROCEDURE FOR ARITHMETIC CODING: Step 1: divide the numeric range 0 to 1 into number of different symbol present in the messages. Step 2: expand the first letter to be coded along with the range .further subdivide this range into number of symbols. Step 3: repeat the procedure until termination character is coded.
  • 24. EXAMPLE: Code the string CAB using arithmetic coding. Character A B C probability 0.6 0.3 0.1
  • 31. EXAMPLE: Consider the transmission of the message “went.” comprising a string of characters with probabilities e=0.3, n=0.3, t=0.2, w=0.1, .=0.1
  • 32. Here the arithmetic codeword range is 0.81602 to 0.8162
  • 33. DIFFERENCE BETWEEN ARITHMETIC CODING AND HUFFMAN CODING ARITHMETICCODING HUFFMANCODING Complex technique for coding short messages Simple techniques Gives optimum results Does not give optimum results There is no one to one correspondence between source symbol and codeword There is one to one correspondence between source symbol and codeword Compression ratio is more Compression ratio is less Execution time is more Execution time is less
  • 34. applications  Arithmetic coding is used in a variety of lossless and lossy compression applications.  It is a part of many international standards.  arithmetic coding is used in image compression, audio compression, and video compression standards.