SlideShare a Scribd company logo
2
Most read
4
Most read
12
Most read
Lossless Image Compression.
By Group 7 Roll no : 1806037 , 1806040 , 1806044 , 1806046.
Image Compression
Image compression is the process of encoding or converting an image file in such a way that it
consumes less space than the original file.
It is a type of compression technique that reduces the size of an image file without affecting or
degrading its quality to a greater extent.
Types of Image compression techniques:
● Lossy compression
● Lossless compression
Size of the second image is reduced with great
extent.
Lossless Image Compression
The goal of lossless image compression is to represent an image signal with the smallest possible
number of bits without loss of any information, thereby speeding up transmission and minimizing
storage requirements.
Lossless Image Compression Techniques.
Huffman Coding
Shannon Fano Coding
Arithmetic Coding.
Huffman Coding
Huffman code is a technique for compressing data. Huffman’s greedy algorithm looks at the
occurrence of each character and it as a binary string in an optimal way. Huffman coding is a
form of statistical coding which attempts to reduce the amount of bits required a string of
symbols.
Algorithmic steps for Huffman Coding :
1. Create a leaf node for each unique character and build a min heap of all leaf node.
2. Extract two nodes with the minimum frequency from the min heap.
3. Create a new internal node with a frequency equal to the sum of the two nodes frequencies. Make the first
extracted node as its left child and the other extracted node as its right child. Add this node to the min heap.
4. Repeat steps#2 and #3 until the heap contains only one node. The remaining node is the root node and the tree
is complete.
Example of Binary Huffman Coding.
Example of Non-Binary Huffman Coding.
Note:- The only difference
between binary and non
binary huffman coding is
that every node except root
of the tree must have more
than two children. That is at
least k children. Where in
case of ternary
Tree k=3 (figure).
Shannon Fano Coding.
Shannon Fano Algorithm is a entropy encoding technique for lossless data
compression of multimedia.
The steps of the algorithm are as follows:
1. Create a list of probabilities or frequency counts for the given set of symbols so that the relative frequency of
occurrence of each symbol is known.
2. Sort the list of symbols in decreasing order of probability, the most probable ones to the left and least probable to the
right.
3. Split the list into two parts, with the total probability of both the parts being as close to each other as possible.
4. Assign the value 0 to the left part and 1 to the right part.
5. Repeat the steps 3 and 4 for each part, until all the symbols are split into individual subgroups.
Example of Shannon Fano Coding.
Arithmetic Coding
Arithmetic Coding is a form of entropy encoding used in lossless data compression. normally , a
string of characters such as the words is represented using a fixed number of bits per character, as
in the ASCII code.In general, each step of the encoding process, except for the very last, is the same; the
encoder has basically just three pieces of data to consider:
● The next symbol that needs to be encoded
● The current interval (at the very start of the encoding process, the interval is set to [0,1], but that will change)
● The probabilities the model assigns to each of the various symbols that are possible at this stage (as mentioned
earlier, higher-order or adaptive models mean that these probabilities are not necessarily the same in each step.)
The encoder divides the current interval into sub-intervals, each representing a fraction of the current interval proportional to
the probability of that symbol in the current context. Whichever interval corresponds to the actual symbol that is next to be
encoded becomes the interval used in the next step.
Example of Arithmetic Coding
Tag Value=(lower limit+upper Limit)/2
Tag Value=(0.14432+0.1456)/2
=0.1449
Merits and Demerits of Lossless Image Compression
Merits
1) Useful for large files
2) Exact data is restored after
re-compression
3) High-quality data
4) No loss of quality, slight
decreases in image file sizes.
Demerits
1) Compression ratio is low
2) Transfer time is high
3) Decoding is difficult
4) Less browser support, slightly
larger file sizes than lossy.
Summary
1) Lossless Compression is a class of data compression algorithms that allows the original data to be perfectly
reconstructed from the compressed data.
2) Lossless compression is used in cases where it is important that the original and the decompressed data be
identical, or where deviations from the original data would be unfavourable.
3) Typical examples are executable programs, text documents, and source code. Some image file formats, like
PNG or GIF, use only lossless compression, while others like TIFF and MNG may use either lossless or lossy
methods.
4) Lossless audio formats are most often used for archiving or production purposes, while smaller lossy audio
files are typically used on portable players and in other cases where storage space is limited or exact replication of
the audio is unnecessary.
References
1. Lossy vs Lossless image compression - A guide to the trade-off between image size and
quality - UpdraftPlus
2. Merits of lossless image compression - Google Search
3. Lossy vs Lossless Compression - KeyCDN Support
4. Lossless_Image_Compression_Techniques_A_State-of-t.pdf ‘
5. Non Binary Huffman coding image - Google Search
6. Image Processing, 2nd Edition.pdf - Google Drive
7. (1) (PDF) New Image Compression/Decompression Technique Using Arithmetic Coding
Algorithm
8. Lossless_Image_Compression_Techniques_A_State-of-t.pdf

More Related Content

PPTX
EXPLORING THE MS WINDOWS ENVIRONMENT
PPTX
Arduino Simulation_Basic_Day-3 (Tinkercad+Proteus PCB)
PPTX
System's Specification
PDF
A research paper_on_lossless_data_compre
DOC
Image compression
PPT
Data Compression
PPTX
Fundamentals of Data compression
PDF
Sunzip user tool for data reduction using huffman algorithm
EXPLORING THE MS WINDOWS ENVIRONMENT
Arduino Simulation_Basic_Day-3 (Tinkercad+Proteus PCB)
System's Specification
A research paper_on_lossless_data_compre
Image compression
Data Compression
Fundamentals of Data compression
Sunzip user tool for data reduction using huffman algorithm

Similar to Lossless image compression.(1) (20)

PPTX
Unit 3 Image Compression and Segmentation.pptx
PPT
111111111111111111111111111111111789.ppt
PPT
111111111111111111111111111111111789.ppt
PDF
Ijrdtvlis11 140006
PPT
Data compression
PDF
Implementation of Lossless Compression Algorithms for Text Data
PPTX
Data compression
PDF
Image compression
PDF
Huffman and Arithmetic coding - Performance analysis
PPTX
image basics and image compression
PPT
PPT
Lossless
PDF
Arithmetic Coding
PPTX
data compression technique
PPTX
Data compression
PPTX
Data Compression and encryption for security
PDF
Compression of digital voice and video
PPTX
Text compression
PPTX
DIP.pptx
PPTX
arithmetic coding for signal and multimedia processing
Unit 3 Image Compression and Segmentation.pptx
111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.ppt
Ijrdtvlis11 140006
Data compression
Implementation of Lossless Compression Algorithms for Text Data
Data compression
Image compression
Huffman and Arithmetic coding - Performance analysis
image basics and image compression
Lossless
Arithmetic Coding
data compression technique
Data compression
Data Compression and encryption for security
Compression of digital voice and video
Text compression
DIP.pptx
arithmetic coding for signal and multimedia processing
Ad

Recently uploaded (20)

PPTX
Orientation - ARALprogram of Deped to the Parents.pptx
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Weekly quiz Compilation Jan -July 25.pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
PPTX
UV-Visible spectroscopy..pptx UV-Visible Spectroscopy – Electronic Transition...
PDF
Computing-Curriculum for Schools in Ghana
PDF
Updated Idioms and Phrasal Verbs in English subject
PDF
Classroom Observation Tools for Teachers
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
Complications of Minimal Access Surgery at WLH
PDF
Trump Administration's workforce development strategy
PDF
01-Introduction-to-Information-Management.pdf
PDF
A systematic review of self-coping strategies used by university students to ...
PPTX
master seminar digital applications in india
PPTX
Lesson notes of climatology university.
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Practical Manual AGRO-233 Principles and Practices of Natural Farming
DOC
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
Orientation - ARALprogram of Deped to the Parents.pptx
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Weekly quiz Compilation Jan -July 25.pdf
Final Presentation General Medicine 03-08-2024.pptx
202450812 BayCHI UCSC-SV 20250812 v17.pptx
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
UV-Visible spectroscopy..pptx UV-Visible Spectroscopy – Electronic Transition...
Computing-Curriculum for Schools in Ghana
Updated Idioms and Phrasal Verbs in English subject
Classroom Observation Tools for Teachers
Supply Chain Operations Speaking Notes -ICLT Program
Complications of Minimal Access Surgery at WLH
Trump Administration's workforce development strategy
01-Introduction-to-Information-Management.pdf
A systematic review of self-coping strategies used by university students to ...
master seminar digital applications in india
Lesson notes of climatology university.
Final Presentation General Medicine 03-08-2024.pptx
Practical Manual AGRO-233 Principles and Practices of Natural Farming
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
Ad

Lossless image compression.(1)

  • 1. Lossless Image Compression. By Group 7 Roll no : 1806037 , 1806040 , 1806044 , 1806046.
  • 2. Image Compression Image compression is the process of encoding or converting an image file in such a way that it consumes less space than the original file. It is a type of compression technique that reduces the size of an image file without affecting or degrading its quality to a greater extent. Types of Image compression techniques: ● Lossy compression ● Lossless compression Size of the second image is reduced with great extent.
  • 3. Lossless Image Compression The goal of lossless image compression is to represent an image signal with the smallest possible number of bits without loss of any information, thereby speeding up transmission and minimizing storage requirements.
  • 4. Lossless Image Compression Techniques. Huffman Coding Shannon Fano Coding Arithmetic Coding.
  • 5. Huffman Coding Huffman code is a technique for compressing data. Huffman’s greedy algorithm looks at the occurrence of each character and it as a binary string in an optimal way. Huffman coding is a form of statistical coding which attempts to reduce the amount of bits required a string of symbols. Algorithmic steps for Huffman Coding : 1. Create a leaf node for each unique character and build a min heap of all leaf node. 2. Extract two nodes with the minimum frequency from the min heap. 3. Create a new internal node with a frequency equal to the sum of the two nodes frequencies. Make the first extracted node as its left child and the other extracted node as its right child. Add this node to the min heap. 4. Repeat steps#2 and #3 until the heap contains only one node. The remaining node is the root node and the tree is complete.
  • 6. Example of Binary Huffman Coding.
  • 7. Example of Non-Binary Huffman Coding. Note:- The only difference between binary and non binary huffman coding is that every node except root of the tree must have more than two children. That is at least k children. Where in case of ternary Tree k=3 (figure).
  • 8. Shannon Fano Coding. Shannon Fano Algorithm is a entropy encoding technique for lossless data compression of multimedia. The steps of the algorithm are as follows: 1. Create a list of probabilities or frequency counts for the given set of symbols so that the relative frequency of occurrence of each symbol is known. 2. Sort the list of symbols in decreasing order of probability, the most probable ones to the left and least probable to the right. 3. Split the list into two parts, with the total probability of both the parts being as close to each other as possible. 4. Assign the value 0 to the left part and 1 to the right part. 5. Repeat the steps 3 and 4 for each part, until all the symbols are split into individual subgroups.
  • 9. Example of Shannon Fano Coding.
  • 10. Arithmetic Coding Arithmetic Coding is a form of entropy encoding used in lossless data compression. normally , a string of characters such as the words is represented using a fixed number of bits per character, as in the ASCII code.In general, each step of the encoding process, except for the very last, is the same; the encoder has basically just three pieces of data to consider: ● The next symbol that needs to be encoded ● The current interval (at the very start of the encoding process, the interval is set to [0,1], but that will change) ● The probabilities the model assigns to each of the various symbols that are possible at this stage (as mentioned earlier, higher-order or adaptive models mean that these probabilities are not necessarily the same in each step.) The encoder divides the current interval into sub-intervals, each representing a fraction of the current interval proportional to the probability of that symbol in the current context. Whichever interval corresponds to the actual symbol that is next to be encoded becomes the interval used in the next step.
  • 11. Example of Arithmetic Coding Tag Value=(lower limit+upper Limit)/2 Tag Value=(0.14432+0.1456)/2 =0.1449
  • 12. Merits and Demerits of Lossless Image Compression Merits 1) Useful for large files 2) Exact data is restored after re-compression 3) High-quality data 4) No loss of quality, slight decreases in image file sizes. Demerits 1) Compression ratio is low 2) Transfer time is high 3) Decoding is difficult 4) Less browser support, slightly larger file sizes than lossy.
  • 13. Summary 1) Lossless Compression is a class of data compression algorithms that allows the original data to be perfectly reconstructed from the compressed data. 2) Lossless compression is used in cases where it is important that the original and the decompressed data be identical, or where deviations from the original data would be unfavourable. 3) Typical examples are executable programs, text documents, and source code. Some image file formats, like PNG or GIF, use only lossless compression, while others like TIFF and MNG may use either lossless or lossy methods. 4) Lossless audio formats are most often used for archiving or production purposes, while smaller lossy audio files are typically used on portable players and in other cases where storage space is limited or exact replication of the audio is unnecessary.
  • 14. References 1. Lossy vs Lossless image compression - A guide to the trade-off between image size and quality - UpdraftPlus 2. Merits of lossless image compression - Google Search 3. Lossy vs Lossless Compression - KeyCDN Support 4. Lossless_Image_Compression_Techniques_A_State-of-t.pdf ‘ 5. Non Binary Huffman coding image - Google Search 6. Image Processing, 2nd Edition.pdf - Google Drive 7. (1) (PDF) New Image Compression/Decompression Technique Using Arithmetic Coding Algorithm 8. Lossless_Image_Compression_Techniques_A_State-of-t.pdf