SlideShare a Scribd company logo
1 of 17
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

What's hot

COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...Hemantha Kulathilake
 
Fourier descriptors & moments
Fourier descriptors & momentsFourier descriptors & moments
Fourier descriptors & momentsrajisri2
 
comparision of lossy and lossless image compression using various algorithm
comparision of lossy and lossless image compression using various algorithmcomparision of lossy and lossless image compression using various algorithm
comparision of lossy and lossless image compression using various algorithmchezhiyan chezhiyan
 
Matlab and Image Processing Workshop-SKERG
Matlab and Image Processing Workshop-SKERG Matlab and Image Processing Workshop-SKERG
Matlab and Image Processing Workshop-SKERG Sulaf Almagooshi
 
Interpixel redundancy
Interpixel redundancyInterpixel redundancy
Interpixel redundancyNaveen Kumar
 
Fundamentals and image compression models
Fundamentals and image compression modelsFundamentals and image compression models
Fundamentals and image compression modelslavanya marichamy
 
5 spatial filtering p1
5 spatial filtering p15 spatial filtering p1
5 spatial filtering p1Gichelle Amon
 
Color Image Processing
Color Image ProcessingColor Image Processing
Color Image Processingkiruthiammu
 
Noise filtering
Noise filteringNoise filtering
Noise filteringAlaa Ahmed
 
Chapter 9 morphological image processing
Chapter 9   morphological image processingChapter 9   morphological image processing
Chapter 9 morphological image processingAhmed Daoud
 
Digital Image Processing: Image Enhancement in the Frequency Domain
Digital Image Processing: Image Enhancement in the Frequency DomainDigital Image Processing: Image Enhancement in the Frequency Domain
Digital Image Processing: Image Enhancement in the Frequency DomainMostafa G. M. Mostafa
 
A Comparative Study of Histogram Equalization Based Image Enhancement Techniq...
A Comparative Study of Histogram Equalization Based Image Enhancement Techniq...A Comparative Study of Histogram Equalization Based Image Enhancement Techniq...
A Comparative Study of Histogram Equalization Based Image Enhancement Techniq...Shahbaz Alam
 

What's hot (20)

COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...
 
Mathematical tools in dip
Mathematical tools in dipMathematical tools in dip
Mathematical tools in dip
 
Fractal Image Compression
Fractal Image CompressionFractal Image Compression
Fractal Image Compression
 
Fourier descriptors & moments
Fourier descriptors & momentsFourier descriptors & moments
Fourier descriptors & moments
 
Jpeg compression
Jpeg compressionJpeg compression
Jpeg compression
 
comparision of lossy and lossless image compression using various algorithm
comparision of lossy and lossless image compression using various algorithmcomparision of lossy and lossless image compression using various algorithm
comparision of lossy and lossless image compression using various algorithm
 
Data Redundacy
Data RedundacyData Redundacy
Data Redundacy
 
Matlab and Image Processing Workshop-SKERG
Matlab and Image Processing Workshop-SKERG Matlab and Image Processing Workshop-SKERG
Matlab and Image Processing Workshop-SKERG
 
Interpixel redundancy
Interpixel redundancyInterpixel redundancy
Interpixel redundancy
 
Fundamentals and image compression models
Fundamentals and image compression modelsFundamentals and image compression models
Fundamentals and image compression models
 
5 spatial filtering p1
5 spatial filtering p15 spatial filtering p1
5 spatial filtering p1
 
Color Image Processing
Color Image ProcessingColor Image Processing
Color Image Processing
 
Image compression .
Image compression .Image compression .
Image compression .
 
Color models
Color modelsColor models
Color models
 
Run length encoding
Run length encodingRun length encoding
Run length encoding
 
Noise filtering
Noise filteringNoise filtering
Noise filtering
 
Chapter 9 morphological image processing
Chapter 9   morphological image processingChapter 9   morphological image processing
Chapter 9 morphological image processing
 
Digital Image Processing: Image Enhancement in the Frequency Domain
Digital Image Processing: Image Enhancement in the Frequency DomainDigital Image Processing: Image Enhancement in the Frequency Domain
Digital Image Processing: Image Enhancement in the Frequency Domain
 
Sharpening spatial filters
Sharpening spatial filtersSharpening spatial filters
Sharpening spatial filters
 
A Comparative Study of Histogram Equalization Based Image Enhancement Techniq...
A Comparative Study of Histogram Equalization Based Image Enhancement Techniq...A Comparative Study of Histogram Equalization Based Image Enhancement Techniq...
A Comparative Study of Histogram Equalization Based Image Enhancement Techniq...
 

Viewers also liked

Data compression huffman coding algoritham
Data compression huffman coding algorithamData compression huffman coding algoritham
Data compression huffman coding algorithamRahul Khanwani
 
Dmcpresentation 120904112322 phpapp01
Dmcpresentation 120904112322 phpapp01Dmcpresentation 120904112322 phpapp01
Dmcpresentation 120904112322 phpapp01sridevi jalakam
 
presentacion de cmc
presentacion de cmcpresentacion de cmc
presentacion de cmcpatripalomo
 
A Novel Technique for Image Steganography Based on DWT and Huffman Encoding
A Novel Technique for Image Steganography Based on DWT and Huffman EncodingA Novel Technique for Image Steganography Based on DWT and Huffman Encoding
A Novel Technique for Image Steganography Based on DWT and Huffman EncodingCSCJournals
 
File compression sunzip (huffman algorithm)
File compression sunzip (huffman algorithm)File compression sunzip (huffman algorithm)
File compression sunzip (huffman algorithm)mini_61
 
Chapter%202%20 %20 Text%20compression(2)
Chapter%202%20 %20 Text%20compression(2)Chapter%202%20 %20 Text%20compression(2)
Chapter%202%20 %20 Text%20compression(2)nes
 
Huffman Tree And Its Application
Huffman Tree And Its ApplicationHuffman Tree And Its Application
Huffman Tree And Its ApplicationPapu Kumar
 
Affable Compression through Lossless Column-Oriented Huffman Coding Technique
Affable Compression through Lossless Column-Oriented Huffman Coding TechniqueAffable Compression through Lossless Column-Oriented Huffman Coding Technique
Affable Compression through Lossless Column-Oriented Huffman Coding TechniqueIOSR Journals
 
Slideshare.Com Powerpoint
Slideshare.Com PowerpointSlideshare.Com Powerpoint
Slideshare.Com Powerpointguested929b
 

Viewers also liked (18)

Huffman Coding
Huffman CodingHuffman Coding
Huffman Coding
 
Data compression huffman coding algoritham
Data compression huffman coding algorithamData compression huffman coding algoritham
Data compression huffman coding algoritham
 
Huffman Coding
Huffman CodingHuffman Coding
Huffman Coding
 
Dmcpresentation 120904112322 phpapp01
Dmcpresentation 120904112322 phpapp01Dmcpresentation 120904112322 phpapp01
Dmcpresentation 120904112322 phpapp01
 
presentacion de cmc
presentacion de cmcpresentacion de cmc
presentacion de cmc
 
Lec32
Lec32Lec32
Lec32
 
Huffman Student
Huffman StudentHuffman Student
Huffman Student
 
A Novel Technique for Image Steganography Based on DWT and Huffman Encoding
A Novel Technique for Image Steganography Based on DWT and Huffman EncodingA Novel Technique for Image Steganography Based on DWT and Huffman Encoding
A Novel Technique for Image Steganography Based on DWT and Huffman Encoding
 
File compression sunzip (huffman algorithm)
File compression sunzip (huffman algorithm)File compression sunzip (huffman algorithm)
File compression sunzip (huffman algorithm)
 
Chapter%202%20 %20 Text%20compression(2)
Chapter%202%20 %20 Text%20compression(2)Chapter%202%20 %20 Text%20compression(2)
Chapter%202%20 %20 Text%20compression(2)
 
Huffman Tree And Its Application
Huffman Tree And Its ApplicationHuffman Tree And Its Application
Huffman Tree And Its Application
 
Huffman codes
Huffman codesHuffman codes
Huffman codes
 
Data compression
Data compression Data compression
Data compression
 
image compression ppt
image compression pptimage compression ppt
image compression ppt
 
Compression
CompressionCompression
Compression
 
Affable Compression through Lossless Column-Oriented Huffman Coding Technique
Affable Compression through Lossless Column-Oriented Huffman Coding TechniqueAffable Compression through Lossless Column-Oriented Huffman Coding Technique
Affable Compression through Lossless Column-Oriented Huffman Coding Technique
 
JPEG Image Compression
JPEG Image CompressionJPEG Image Compression
JPEG Image Compression
 
Slideshare.Com Powerpoint
Slideshare.Com PowerpointSlideshare.Com Powerpoint
Slideshare.Com Powerpoint
 

Similar to Hufman coding basic

Fundamentals of Data compression
Fundamentals of Data compressionFundamentals of Data compression
Fundamentals of Data compressionM.k. Praveen
 
image basics and image compression
image basics and image compressionimage basics and image compression
image basics and image compressionmurugan hari
 
Chapter 4 Lossless Compression Algorithims.pptx
Chapter 4 Lossless Compression Algorithims.pptxChapter 4 Lossless Compression Algorithims.pptx
Chapter 4 Lossless Compression Algorithims.pptxMedinaBedru
 
2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...
2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...
2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...Helan4
 
Comparision Of Various Lossless Image Compression Techniques
Comparision Of Various Lossless Image Compression TechniquesComparision Of Various Lossless Image Compression Techniques
Comparision Of Various Lossless Image Compression TechniquesIJERA Editor
 
A research paper_on_lossless_data_compre
A research paper_on_lossless_data_compreA research paper_on_lossless_data_compre
A research paper_on_lossless_data_compreLuisa Francisco
 
INSTRUCTIONS For this assignment you will be generating all code on y.pdf
 INSTRUCTIONS For this assignment you will be generating all code on y.pdf INSTRUCTIONS For this assignment you will be generating all code on y.pdf
INSTRUCTIONS For this assignment you will be generating all code on y.pdfadayarboot
 
j001adcpresentation-2112170415 23.pdf
j001adcpresentation-2112170415      23.pdfj001adcpresentation-2112170415      23.pdf
j001adcpresentation-2112170415 23.pdfHarshSharma71048
 
Huffman Algorithm and its Application by Ekansh Agarwal
Huffman Algorithm and its Application by Ekansh AgarwalHuffman Algorithm and its Application by Ekansh Agarwal
Huffman Algorithm and its Application by Ekansh AgarwalEkansh Agarwal
 
cp467_12_lecture14_image compression1.pdf
cp467_12_lecture14_image compression1.pdfcp467_12_lecture14_image compression1.pdf
cp467_12_lecture14_image compression1.pdfshaikmoosa2003
 
Data compression & Classification
Data compression & ClassificationData compression & Classification
Data compression & ClassificationKhulna University
 
Sunzip user tool for data reduction using huffman algorithm
Sunzip user tool for data reduction using huffman algorithmSunzip user tool for data reduction using huffman algorithm
Sunzip user tool for data reduction using huffman algorithmDr Sandeep Kumar Poonia
 

Similar to Hufman coding basic (20)

Text compression
Text compressionText compression
Text compression
 
Fundamentals of Data compression
Fundamentals of Data compressionFundamentals of Data compression
Fundamentals of Data compression
 
image basics and image compression
image basics and image compressionimage basics and image compression
image basics and image compression
 
Data Compression
Data CompressionData Compression
Data Compression
 
Data compression
Data compressionData compression
Data compression
 
Chapter 4 Lossless Compression Algorithims.pptx
Chapter 4 Lossless Compression Algorithims.pptxChapter 4 Lossless Compression Algorithims.pptx
Chapter 4 Lossless Compression Algorithims.pptx
 
Data compression
Data  compressionData  compression
Data compression
 
2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...
2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...
2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...
 
Comparision Of Various Lossless Image Compression Techniques
Comparision Of Various Lossless Image Compression TechniquesComparision Of Various Lossless Image Compression Techniques
Comparision Of Various Lossless Image Compression Techniques
 
Data compression
Data compressionData compression
Data compression
 
Compress
CompressCompress
Compress
 
A research paper_on_lossless_data_compre
A research paper_on_lossless_data_compreA research paper_on_lossless_data_compre
A research paper_on_lossless_data_compre
 
Lec5 Compression
Lec5 CompressionLec5 Compression
Lec5 Compression
 
INSTRUCTIONS For this assignment you will be generating all code on y.pdf
 INSTRUCTIONS For this assignment you will be generating all code on y.pdf INSTRUCTIONS For this assignment you will be generating all code on y.pdf
INSTRUCTIONS For this assignment you will be generating all code on y.pdf
 
j001adcpresentation-2112170415 23.pdf
j001adcpresentation-2112170415      23.pdfj001adcpresentation-2112170415      23.pdf
j001adcpresentation-2112170415 23.pdf
 
Huffman Algorithm and its Application by Ekansh Agarwal
Huffman Algorithm and its Application by Ekansh AgarwalHuffman Algorithm and its Application by Ekansh Agarwal
Huffman Algorithm and its Application by Ekansh Agarwal
 
Image compression
Image compressionImage compression
Image compression
 
cp467_12_lecture14_image compression1.pdf
cp467_12_lecture14_image compression1.pdfcp467_12_lecture14_image compression1.pdf
cp467_12_lecture14_image compression1.pdf
 
Data compression & Classification
Data compression & ClassificationData compression & Classification
Data compression & Classification
 
Sunzip user tool for data reduction using huffman algorithm
Sunzip user tool for data reduction using huffman algorithmSunzip user tool for data reduction using huffman algorithm
Sunzip user tool for data reduction using huffman algorithm
 

Recently uploaded

An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfSanaAli374401
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterMateoGardella
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
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
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
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
 

Recently uploaded (20)

An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
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
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
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
 

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.