0% found this document useful (0 votes)
25 views

DIP Huffman & Arithmetic Coding Ppt

The document discusses image compression techniques, specifically Huffman and Arithmetic coding, highlighting their importance in reducing storage requirements, speeding up transmission, and preserving image quality. It explains the differences between lossless and lossy compression, detailing the processes involved in Huffman coding and Arithmetic coding. Additionally, it outlines the applications of these techniques in various digital formats and fields such as medical imaging and video coding.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

DIP Huffman & Arithmetic Coding Ppt

The document discusses image compression techniques, specifically Huffman and Arithmetic coding, highlighting their importance in reducing storage requirements, speeding up transmission, and preserving image quality. It explains the differences between lossless and lossy compression, detailing the processes involved in Huffman coding and Arithmetic coding. Additionally, it outlines the applications of these techniques in various digital formats and fields such as medical imaging and video coding.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

IMAGE

COMPRESSION:
Huffman & Arithmetic
Coding
Efficient Encoding in Digital
Image Processing

Sanya Behera | 01517711622


| AIML-A
1
WHY IMAGE
COMPRESSION?
📌 Reduces Storage Requirements
Large images consume more space and slow down data
processing & retrieval.
📌 Speeds Up Transmission
Smaller file sizes enable faster uploads, downloads, and
streaming.
📌 Preserves Quality Efficiently
Compression minimizes file size while maintaining visual clarity.
📌 Widely Used in Digital Formats
Applied in JPEG, PNG, HEVC, JPEG2000 for efficient storage &
streaming.
2
LOSSLESS VS. LOSSY
COMPRESSION
Lossless Lossy
Compression
• No Data Loss Compression
• High Data Loss
• Retains •Sacrifices Some
• Lower
QualityCompression •Higher
Quality Compression
• Examples: PNG,
Ratios •Examples: JPEG,
Ratios
• Used
TIFF for: •Used
MP3 for:
Medical Imaging, Photos, Videos,
Text, Icons Online Content
HUFFMAN CODING IN 3

IMAGE COMPRESSION
Huffman coding is a lossless compression technique that assigns
shorter binary codes to frequently occurring pixels in an image,
reducing storage without losing data.

Tree Approach Matrix Approach


Constructs a binary tree Uses a table to store
where frequently occurring relationships between
symbols are closer to the pixel values and Huffman
root, leading to shorter codes for faster lookup.
codes.
TREE APPROACH 4

1.Calculate Pixel Frequencies →


Count how often each pixel
intensity appears.
2.Build a Huffman Tree →
⚬ Start with the two least frequent
pixel values and merge them
into a node.
⚬ Repeat until only one node
remains (the root).
3.Assign Binary Codes →
⚬ Left branch = 0, Right branch =
1
⚬•Frequently
For images weoccurring values
can use intensity get
values in the range 0-255.
•shorter
Normally, codes.
each pixel is stored in 8 bits, but with Huffman coding, frequent pixels use fewer
4.Compress the file
bits, reducing Image
size. → Replace
pixel values
• Instead with raw
of storing their Huffman
8-bit pixel values, we store the Huffman-encoded binary codes.
‘o’ = 1, ‘u’ = 1, ‘x’ = 1, ‘p’ = 1, ‘r’ = 1, ‘l’ =
1, ‘n’ = 2, ‘t’ = 2, 5
‘m’ = 2, ‘i’ = 2, ‘h’ = 2, ‘s’ = 2, ‘f’ = 3, ‘e’ =
0 1
4, ‘a’ = 4, ‘ ‘ = 7 ‘‘=
111
0 1 0 1 ‘a’ =
010
0 1 0 1 0 1 0 1 ‘e’ =
000
0 1 0 1 0 1 0 1 0 1 ‘i’ =
1000
0 1 0 1 0 1
‘o’ =
00110
6
MATRIX APPROACH
1 Frequency 3 Assign Codes
Calculation
Store symbols and their As the matrix is merged,
frequencies in a matrix. assign binary codes based
on the order of merging.
2 Matrix Merging Record these codes in a
separate matrix column or
• Iteratively merge the two
structure.
smallest frequency rows in 4 Compression
the matrix. Create a new
Use the generated binary
row with the combined
codes to replace the
frequency and append it
symbols in the original
back into the matrix.
data, achieving
• Repeat until only one row
compression.
Step 1: Huffman source 7
reductions

Step 2: Huffman code assignment


procedure.
ARITHMETIC CODING IN 8

Image Compression
• Arithmetic coding is a form of
entropy encoding that converts Step 1: Step 2: Step 3:
an entire message into a single Convert Build Encode
floating-point number between 0
Image to Probabil Using
Symbol ity Range
and 1. Unlike Huffman coding, Sequence Model
which assigns integer-length Convert pixel Estimate how Narrow down a
codes to symbols, arithmetic values into often each range [0, 1)
symbols symbol (pixel based on
coding assigns fractional values, (numbers). value) symbol
appears. probabilities.
leading to more efficient Example: If 50
compression. occurs 25% of
the time, its
• It is a lossless data compression range is [0,
technique that encodes the 0.25).
{a1,a2,a3, a1 a2 a3 a3
Consider the and consider the
a4} a4 9
Thesymbols:
table defines a cumulative range for sequence:
each symbol,
dividing the interval [0,1]
Each symbol occupies a portion of the interval [0,1],
Encoding
based on its probability.
Process:
1.Start with the full range [0,1].
2.Choose the first symbol and update the range
based on its assigned interval.
3.Repeat the process for each new symbol, zooming
into the interval assigned to the last symbol seen.
4.The final interval represents the entire message as
a single floating-point number.
10
WHERE ARE THESE USED
📌 Huffman Coding:
IN DIP?
• Used in PNG, TIFF, and JPEG for entropy coding.
• Efficient for lossless compression by assigning shorter
codes to frequent symbols.
📌 Arithmetic Coding:
• Implemented in JPEG2000, HEVC (High-Efficiency Video
Coding) for improved video and image compression.
• Offers better compression efficiency than Huffman
coding.
📌 Medical & Satellite Imaging:
• Prefers Arithmetic Coding due to its higher compression
efficiency, crucial for storing and transmitting large
datasets.
THANK YOU
Presented By: Sanya
Behera
Enrolment no:
01517711622

You might also like