SlideShare a Scribd company logo
DIGITAL IMAGE PROCESSING
TOPIC: HUFFMAN CODING
NAME :J.RADTHEES
R.NO :15MFS04
Introduction
Digital image coding and compression:
Techniques and algorithms concerned with the minimization of
the memory needed to represent and store digital images.
Compression factors:
Transmission and storing of large images
Reduce of baud rate
Baud rate means number of data bits transmitted in one second.
Reduce of transmission time.
Lossless compression techniques:
These are used when raw image data are difficult to obtain or
contain vital information that may be destroyed by compression.
EX:-Medical diagnostic imaging.
Lossy compression techniques:
These can be used when raw image data can be easily
reproduced or when the information loss can be tolerated at the receiver
site.
EX:-Facebook images.
Huffman Coding
• There are many ways to store information.Computer
sceintists are always looking for new and better ways to
store strings of data with little space as possible.
• Huffman coding is a method of storing strings of data as
binary code in an efficient manner.
• Huffman coding uses ‘lossless data compression ‘,which
means no information is lost.
5
• It makes use of a binary tree to develop codes of varying lengths for
the letters used in the original message. which means that symbols in
the data you are encoded are converted to a binary symbol based on
how often that symbol is used. For example : If the character ‘a’ is
used in your data a lot,the binary symbol representing it is shorter.If it
is used rarely,the symbol representing it is longer.This way all the
data will take less physical space when encoded.
• Huffman code is also part of the JPEG image compression scheme.
• The algorithm was introduced by David Huffman in 1952 as part of a
course assignment at MIT.
Algorithm:
Example:
Char Frequency
a 1
b 6
c 7
d 2
e 8
a:1 b:6 c:7 d:2 e:8
Imagine these as 5 separate trees and combine
two smallest trees in order
1. List all the letters used,along with the
frequency with which they occur in the
message.
2. Consider each of these (character,frequency)
pairs to be nodes; they are actually leaf nodes,
as we will see.
3. Pick the two nodes with the lowest frequency,
and if there is a tie, pick randomly amongst
those with equal frequencies.
Char Frequency
a 1
b 6
c 7
d 2
E 8
a:1
b:6 c:7
d:2
e:8
3
4. Make a new node out of these two, and make the two nodes its children.
5. This new node is assigned the sum of the frequencies of its children.
6.Continue the process of combining the two nodes of lowest frequency until
only one node, the root, remains.
Char Frequency
a 1
b 6
c 7
d 2
e 8
a:1
b:6
c:7
d:2
e:8
3
9
Char Frequency
a 1
b 6
c 7
d 2
e 8
a:1
b:6
d:2
3
9
c:7 e:8
15
Char Frequency
a 1
b 6
c 7
d 2
e 8
Now we have large tree containing all
characters,we now assign binary data to each
symbol by gong down the tree.
a:1
b:6
d:2
3
9
c:7 e:8
15
24
Char Frequency
a 1
b 6
c 7
d 2
e 8
a:1
b:6
d:2
3
9
c:7 e:8
15
24
0
0
0
1
1
1
10
7. Start at the root. Assign 0 to left branch and 1 to the right branch.
8.Repeat the process down the left and right subtrees.
9. To get the code for a character, traverse the tree from the root to the
character leaf node and read off the 0 and 1 along the path.
A=000
B=01
C=10
D=001
E=11
a:
1
b:
6
d:
2
3
9
c:7
e:
8
15
24
0
0
0
1
1
1
10
This is what a,b,c,d,e each will
be converted to,
Char Freque
ncy
Bits Huffm
an bits
a 1 000 3
b 6 01 12
c 7 10 14
d 2 001 6
e 8 11 16
Total 51
Encoding:
Encoding is the process of putting a sequence of characters
into a specialized format for efficient transmission or storage.
A=000
b=01
c=10
d=001
e=11
Encode abcde using the results from huffman coding.
Abcde=000011000111
Decoding:
Decoding is the conversion of an encoded format back into the
original sequence of characters.
•Decode 1011001000011101
•Compare the above representations above to the binary code bit by bit
to fill only the possible result.
101100100001101= c 11001000011101(only c starts with 1,then 0)
= c e 001000011101(only e starts with 1,then 1)
= c e d 000011101(only d starts with 0,then 0,then
= c e d a01101(only a starts with 0,then 0,then 0)
= c e d a b1101(only b starts with 0,then 1)
= c e d a b e01(only e starts with 1,then 1)
= c e d a b e b(only b starts with 0,then 1)
Applications:
•Supports various file types.
ZIP(Multichannel compression including text and other data
types)
JPEG
MPEG(only 2 layers)
•Also used in stegnography for JPEG carrier compression.
Thank you…

More Related Content

PDF
Instruction types
JyotiprakashMishra18
 
PPTX
Translation lookaside buffer
Chetan Mahawar
 
PPTX
agent architecture in artificial intelligence.pptx
PriyadharshiniG41
 
PDF
Medical Equipment Ultrasound Lecture 4
cairo university
 
PPTX
Alter G Sales Presentation For Pt
Maegan Kopka
 
PDF
Rasta processing of speech
Benjamin Bengfort
 
PPTX
Biomechatronics: Simulated Fingers and Hands
Mzg Kkr
 
PPTX
computer arithmetic’s (fixed and floating point)
DipakMahurkar1
 
Instruction types
JyotiprakashMishra18
 
Translation lookaside buffer
Chetan Mahawar
 
agent architecture in artificial intelligence.pptx
PriyadharshiniG41
 
Medical Equipment Ultrasound Lecture 4
cairo university
 
Alter G Sales Presentation For Pt
Maegan Kopka
 
Rasta processing of speech
Benjamin Bengfort
 
Biomechatronics: Simulated Fingers and Hands
Mzg Kkr
 
computer arithmetic’s (fixed and floating point)
DipakMahurkar1
 

What's hot (9)

PPT
8085 microprocessor architecture ppt
Parvesh Gautam
 
PDF
19IS305_U1_LP3_LM3-22-23-2.pdf
GOWTHAMR721887
 
PPT
8051 instruction set
Andri Prastiyo
 
PPT
chapt_02.ppt
Ranaqamar6
 
PPTX
VLSI Domain interview questions.pptx
HasmukhKoringa1
 
PPT
Parallel processing Concepts
Army Public School and College -Faisal
 
PPTX
DBMS Presentation.pptx
PravinBhargav1
 
PPTX
Data Path Design and Bus Organization.pptx
sarthakgithub
 
DOCX
Write a program to check a given number is prime or not
aluavi
 
8085 microprocessor architecture ppt
Parvesh Gautam
 
19IS305_U1_LP3_LM3-22-23-2.pdf
GOWTHAMR721887
 
8051 instruction set
Andri Prastiyo
 
chapt_02.ppt
Ranaqamar6
 
VLSI Domain interview questions.pptx
HasmukhKoringa1
 
Parallel processing Concepts
Army Public School and College -Faisal
 
DBMS Presentation.pptx
PravinBhargav1
 
Data Path Design and Bus Organization.pptx
sarthakgithub
 
Write a program to check a given number is prime or not
aluavi
 
Ad

Viewers also liked (18)

PPTX
Huffman Coding
Ehtisham Ali
 
PDF
Data compression huffman coding algoritham
Rahul Khanwani
 
PPT
Huffman Coding
anithabalaprabhu
 
PDF
Dmcpresentation 120904112322 phpapp01
sridevi jalakam
 
PPTX
presentacion de cmc
patripalomo
 
PPT
Huffman Student
anithabalaprabhu
 
PDF
A Novel Technique for Image Steganography Based on DWT and Huffman Encoding
CSCJournals
 
PDF
File compression sunzip (huffman algorithm)
mini_61
 
PPT
Chapter%202%20 %20 Text%20compression(2)
nes
 
PPT
Huffman Tree And Its Application
Papu Kumar
 
PPTX
Huffman codes
Nargis Ehsan
 
PPTX
Data compression
Muhammad Irtiza
 
ODP
image compression ppt
Shivangi Saxena
 
PPT
Compression
Ashish Kumar
 
PDF
Affable Compression through Lossless Column-Oriented Huffman Coding Technique
IOSR Journals
 
PPTX
JPEG Image Compression
Aishwarya K. M.
 
PPTX
Slideshare.Com Powerpoint
guested929b
 
Huffman Coding
Ehtisham Ali
 
Data compression huffman coding algoritham
Rahul Khanwani
 
Huffman Coding
anithabalaprabhu
 
Dmcpresentation 120904112322 phpapp01
sridevi jalakam
 
presentacion de cmc
patripalomo
 
Huffman Student
anithabalaprabhu
 
A Novel Technique for Image Steganography Based on DWT and Huffman Encoding
CSCJournals
 
File compression sunzip (huffman algorithm)
mini_61
 
Chapter%202%20 %20 Text%20compression(2)
nes
 
Huffman Tree And Its Application
Papu Kumar
 
Huffman codes
Nargis Ehsan
 
Data compression
Muhammad Irtiza
 
image compression ppt
Shivangi Saxena
 
Compression
Ashish Kumar
 
Affable Compression through Lossless Column-Oriented Huffman Coding Technique
IOSR Journals
 
JPEG Image Compression
Aishwarya K. M.
 
Slideshare.Com Powerpoint
guested929b
 
Ad

Similar to Hufman coding basic (20)

PPTX
Text compression
Sammer Qader
 
PPTX
Fundamentals of Data compression
M.k. Praveen
 
PPTX
image basics and image compression
murugan hari
 
PPT
Data Compression
Shubham Bammi
 
PPTX
Data compression
Chaitanya Belhekar
 
PPTX
Chapter 4 Lossless Compression Algorithims.pptx
MedinaBedru
 
PPTX
Data compression
Ashutosh Kawadkar
 
PPT
2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...
Helan4
 
PDF
Comparision Of Various Lossless Image Compression Techniques
IJERA Editor
 
PPT
Data compression
Abhishek Grover
 
PDF
Huffman Encoding Algorithm - Concepts and Example
MaryJacob24
 
PPT
Compress
Chhaya Narvekar
 
PPTX
Data compression
Sherif Abdelfattah
 
PDF
A research paper_on_lossless_data_compre
Luisa Francisco
 
PPT
Lec5 Compression
anithabalaprabhu
 
PDF
INSTRUCTIONS For this assignment you will be generating all code on y.pdf
adayarboot
 
PDF
j001adcpresentation-2112170415 23.pdf
HarshSharma71048
 
PPTX
Huffman Algorithm and its Application by Ekansh Agarwal
Ekansh Agarwal
 
DOC
Image compression
Shiva Krishna Chandra Shekar
 
PDF
cp467_12_lecture14_image compression1.pdf
shaikmoosa2003
 
Text compression
Sammer Qader
 
Fundamentals of Data compression
M.k. Praveen
 
image basics and image compression
murugan hari
 
Data Compression
Shubham Bammi
 
Data compression
Chaitanya Belhekar
 
Chapter 4 Lossless Compression Algorithims.pptx
MedinaBedru
 
Data compression
Ashutosh Kawadkar
 
2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...
Helan4
 
Comparision Of Various Lossless Image Compression Techniques
IJERA Editor
 
Data compression
Abhishek Grover
 
Huffman Encoding Algorithm - Concepts and Example
MaryJacob24
 
Compress
Chhaya Narvekar
 
Data compression
Sherif Abdelfattah
 
A research paper_on_lossless_data_compre
Luisa Francisco
 
Lec5 Compression
anithabalaprabhu
 
INSTRUCTIONS For this assignment you will be generating all code on y.pdf
adayarboot
 
j001adcpresentation-2112170415 23.pdf
HarshSharma71048
 
Huffman Algorithm and its Application by Ekansh Agarwal
Ekansh Agarwal
 
Image compression
Shiva Krishna Chandra Shekar
 
cp467_12_lecture14_image compression1.pdf
shaikmoosa2003
 

Recently uploaded (20)

PDF
7.Particulate-Nature-of-Matter.ppt/8th class science curiosity/by k sandeep s...
Sandeep Swamy
 
PDF
UTS Health Student Promotional Representative_Position Description.pdf
Faculty of Health, University of Technology Sydney
 
PDF
PG-BPSDMP 2 TAHUN 2025PG-BPSDMP 2 TAHUN 2025.pdf
AshifaRamadhani
 
DOCX
Action Plan_ARAL PROGRAM_ STAND ALONE SHS.docx
Levenmartlacuna1
 
PPTX
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
PPTX
Care of patients with elImination deviation.pptx
AneetaSharma15
 
PPTX
How to Manage Global Discount in Odoo 18 POS
Celine George
 
PDF
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
PDF
1.Natural-Resources-and-Their-Use.ppt pdf /8th class social science Exploring...
Sandeep Swamy
 
PDF
5.EXPLORING-FORCES-Detailed-Notes.pdf/8TH CLASS SCIENCE CURIOSITY
Sandeep Swamy
 
PDF
Phylum Arthropoda: Characteristics and Classification, Entomology Lecture
Miraj Khan
 
PPTX
Measures_of_location_-_Averages_and__percentiles_by_DR SURYA K.pptx
Surya Ganesh
 
PPT
Python Programming Unit II Control Statements.ppt
CUO VEERANAN VEERANAN
 
PPTX
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
PPTX
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 
PDF
2.Reshaping-Indias-Political-Map.ppt/pdf/8th class social science Exploring S...
Sandeep Swamy
 
PPTX
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
PDF
Exploring-Forces 5.pdf/8th science curiosity/by sandeep swamy notes/ppt
Sandeep Swamy
 
PPTX
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
PPTX
Odoo 18 Sales_ Managing Quotation Validity
Celine George
 
7.Particulate-Nature-of-Matter.ppt/8th class science curiosity/by k sandeep s...
Sandeep Swamy
 
UTS Health Student Promotional Representative_Position Description.pdf
Faculty of Health, University of Technology Sydney
 
PG-BPSDMP 2 TAHUN 2025PG-BPSDMP 2 TAHUN 2025.pdf
AshifaRamadhani
 
Action Plan_ARAL PROGRAM_ STAND ALONE SHS.docx
Levenmartlacuna1
 
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
Care of patients with elImination deviation.pptx
AneetaSharma15
 
How to Manage Global Discount in Odoo 18 POS
Celine George
 
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
1.Natural-Resources-and-Their-Use.ppt pdf /8th class social science Exploring...
Sandeep Swamy
 
5.EXPLORING-FORCES-Detailed-Notes.pdf/8TH CLASS SCIENCE CURIOSITY
Sandeep Swamy
 
Phylum Arthropoda: Characteristics and Classification, Entomology Lecture
Miraj Khan
 
Measures_of_location_-_Averages_and__percentiles_by_DR SURYA K.pptx
Surya Ganesh
 
Python Programming Unit II Control Statements.ppt
CUO VEERANAN VEERANAN
 
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 
2.Reshaping-Indias-Political-Map.ppt/pdf/8th class social science Exploring S...
Sandeep Swamy
 
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
Exploring-Forces 5.pdf/8th science curiosity/by sandeep swamy notes/ppt
Sandeep Swamy
 
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
Odoo 18 Sales_ Managing Quotation Validity
Celine George
 

Hufman coding basic

  • 1. DIGITAL IMAGE PROCESSING TOPIC: HUFFMAN CODING NAME :J.RADTHEES R.NO :15MFS04
  • 2. Introduction Digital image coding and compression: Techniques and algorithms concerned with the minimization of the memory needed to represent and store digital images. Compression factors: Transmission and storing of large images Reduce of baud rate Baud rate means number of data bits transmitted in one second. Reduce of transmission time.
  • 3. Lossless compression techniques: These are used when raw image data are difficult to obtain or contain vital information that may be destroyed by compression. EX:-Medical diagnostic imaging. Lossy compression techniques: These can be used when raw image data can be easily reproduced or when the information loss can be tolerated at the receiver site. EX:-Facebook images.
  • 4. Huffman Coding • There are many ways to store information.Computer sceintists are always looking for new and better ways to store strings of data with little space as possible. • Huffman coding is a method of storing strings of data as binary code in an efficient manner. • Huffman coding uses ‘lossless data compression ‘,which means no information is lost.
  • 5. 5 • It makes use of a binary tree to develop codes of varying lengths for the letters used in the original message. which means that symbols in the data you are encoded are converted to a binary symbol based on how often that symbol is used. For example : If the character ‘a’ is used in your data a lot,the binary symbol representing it is shorter.If it is used rarely,the symbol representing it is longer.This way all the data will take less physical space when encoded. • Huffman code is also part of the JPEG image compression scheme. • The algorithm was introduced by David Huffman in 1952 as part of a course assignment at MIT.
  • 7. Example: Char Frequency a 1 b 6 c 7 d 2 e 8 a:1 b:6 c:7 d:2 e:8 Imagine these as 5 separate trees and combine two smallest trees in order 1. List all the letters used,along with the frequency with which they occur in the message. 2. Consider each of these (character,frequency) pairs to be nodes; they are actually leaf nodes, as we will see. 3. Pick the two nodes with the lowest frequency, and if there is a tie, pick randomly amongst those with equal frequencies.
  • 8. Char Frequency a 1 b 6 c 7 d 2 E 8 a:1 b:6 c:7 d:2 e:8 3 4. Make a new node out of these two, and make the two nodes its children. 5. This new node is assigned the sum of the frequencies of its children. 6.Continue the process of combining the two nodes of lowest frequency until only one node, the root, remains.
  • 9. Char Frequency a 1 b 6 c 7 d 2 e 8 a:1 b:6 c:7 d:2 e:8 3 9
  • 10. Char Frequency a 1 b 6 c 7 d 2 e 8 a:1 b:6 d:2 3 9 c:7 e:8 15
  • 11. Char Frequency a 1 b 6 c 7 d 2 e 8 Now we have large tree containing all characters,we now assign binary data to each symbol by gong down the tree. a:1 b:6 d:2 3 9 c:7 e:8 15 24
  • 12. Char Frequency a 1 b 6 c 7 d 2 e 8 a:1 b:6 d:2 3 9 c:7 e:8 15 24 0 0 0 1 1 1 10 7. Start at the root. Assign 0 to left branch and 1 to the right branch. 8.Repeat the process down the left and right subtrees. 9. To get the code for a character, traverse the tree from the root to the character leaf node and read off the 0 and 1 along the path.
  • 13. A=000 B=01 C=10 D=001 E=11 a: 1 b: 6 d: 2 3 9 c:7 e: 8 15 24 0 0 0 1 1 1 10 This is what a,b,c,d,e each will be converted to, Char Freque ncy Bits Huffm an bits a 1 000 3 b 6 01 12 c 7 10 14 d 2 001 6 e 8 11 16 Total 51
  • 14. Encoding: Encoding is the process of putting a sequence of characters into a specialized format for efficient transmission or storage. A=000 b=01 c=10 d=001 e=11 Encode abcde using the results from huffman coding. Abcde=000011000111
  • 15. Decoding: Decoding is the conversion of an encoded format back into the original sequence of characters. •Decode 1011001000011101 •Compare the above representations above to the binary code bit by bit to fill only the possible result. 101100100001101= c 11001000011101(only c starts with 1,then 0) = c e 001000011101(only e starts with 1,then 1) = c e d 000011101(only d starts with 0,then 0,then = c e d a01101(only a starts with 0,then 0,then 0) = c e d a b1101(only b starts with 0,then 1) = c e d a b e01(only e starts with 1,then 1) = c e d a b e b(only b starts with 0,then 1)
  • 16. Applications: •Supports various file types. ZIP(Multichannel compression including text and other data types) JPEG MPEG(only 2 layers) •Also used in stegnography for JPEG carrier compression.