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.
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.
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.