Image Compression 2 Update
Image Compression 2 Update
By
Dr. Fadwa Al Azzo
[email protected]
Multimedia Computing
The only Lossy element is the Quantizer which removes the psychovisual redundancies causing irreversible loss.
Every Lossy Compression methods contain the quantizer module.
If Error-Free compression is desired the quantizer module is removed.
Image Compression
Information Theory-Entropy
• Entropy encoding is a method of lossless compression that is performed on an image after the
quantization stage. It enables one to represent an image in a more efficient way with less memory
needed for storage or transmission.
• The information per source (symbol or pixel), which is also referred as entropy is calculated by:
• Measuring Information: The entropy of the given 8-bit image segment can be calculated by:
2
ln(𝑛𝑢𝑚)
𝑙𝑜𝑔2 (𝑛𝑢𝑚) =
ln(2)
Solution:
3
3 ln(8) −0.98
𝑙𝑜𝑔2 = = = −1.42
8 ln(2) 0.69
1
1 ln(8) −2.07
𝑙𝑜𝑔2 = = = −3.01
8 ln(2) 0.69
3 3 1 1 1 1 3 3
E=- [ 𝑙𝑜𝑔2 + 𝑙𝑜𝑔2 + 𝑙𝑜𝑔2 + 𝑙𝑜𝑔2 ]
8 8 8 8 8 8 8 8
• Huffman Coding
• Huffman Coding: Note that the shortest codeword (1) is given for the symbol/pixel with the highest
probability (𝑎2 ). The longest codeword (01011) is given for the symbol/pixel with the lowest probability
(𝑎5 ).
• The average length of the code is given by: