0% found this document useful (0 votes)
8 views15 pages

Lecture 5-Lossless Image Comp-other Techniques

The document discusses lossless image compression techniques, specifically focusing on run-length encoding and lossless predictive coding. It explains the process of converting gray-scale images into bit-plane images and illustrates the application of run-length coding to achieve significant bit savings. Additionally, it outlines assignments for practical application of the concepts covered, including comparisons of bit-plane representations and compression ratios.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views15 pages

Lecture 5-Lossless Image Comp-other Techniques

The document discusses lossless image compression techniques, specifically focusing on run-length encoding and lossless predictive coding. It explains the process of converting gray-scale images into bit-plane images and illustrates the application of run-length coding to achieve significant bit savings. Additionally, it outlines assignments for practical application of the concepts covered, including comparisons of bit-plane representations and compression ratios.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 15

Multimedia Systems and Applications

Sudipta Mahapatra

1
Other Schemes for
Lossless Image Compression

2
Outline

• Run length Encoding


• Lossless predictive coding scheme

3
Converting a gray-scale image into bit-plane images

• Let s be any integer in the range 0<=2 n-1


• We can write,
n 1 n 2 0
s an  1 2  an  2 2  ...  a0 2
• All pixel values having pixel values in the
range [0,255] can be represented with 8-bits.
• We get the ith bit plane image by considering
an array containing only the ith bit of every
pixel.

4
Example

• Consider the 44 array,


13 (1101) 12 (1100 ) 13 (1101) 9 (1001)
15 (1111 ) 13 (1101) 11 (1011) 10 (1010)
14 (1110 ) 11 (1011) 12 (1100 ) 9 (1001)
11 (1011) 12 (1100 ) 14 (1110 ) 7 (0111)
• Corresponding bit-planes are:
1 1 1 1 1 1 1 0 0 0 0 0 1 0 1 1
1 1 1 1 1 1 0 0 1 0 1 1 1 1 1 0
1 1 1 1 1 0 1 0 1 1 0 0 0 1 0 1
1 1 1 0 0 1 1 1 1 0 1 1 1 0 0 1

5
Run-length Coding of bit-plane images
• In 1D RL coding for binary images, runs of
continuous 1s or 0s in every row of an image
are encoded together.
• Results in substantial bit savings.
• Indicate whether the row begins with a run of
1s or 0s, or the encoding of a row compulsorily
begins with 1s, where the count could be zero,
if it begins with 0s.

6
Example
• For the string,
00011010001111100101111111111111110111000
00000010000111111100000001 (67 symbols)
• Assuming that the coding always begins with
count of ones, coded string
0,3,2,1,1,3,5,2,1,1,15,1,3,9,1,4,7,7,1 (20)

7
Run-length Entropy
• The run length entropy is given by,
H 0  H1
HR 
L0  L1
•H0/H1– Entropies for runs of 0s and 1s and
L0/L1 are the average values of run-lengths of
0s and 1s.
• Run-length encoding can be applied to gray
scale images by first decomposing them to
bit-plane images.
8
Lossless Predictive Coding

● e(n1,n2) = s (n1, n 2)  sˆ(n1, n 2)

● sˆ(n1, n2) = a1s (n1  1, n 2  1) 


a2 sˆ(n1  1, n 2) 
a3sˆ(n1  1, n 2  1) 
a4 sˆ(n1, n 2  1) 9
Example
Resized gray scale image

x
pi  i
N

Lena Image Histogram

10
Example
• Add an offset of intensity value 127 to all the
pixels to display the negative intensity values
as well. Error PDF
0.1

Probability Dostribution Function---->


Error Image

0.08

0.06

0.04

0.02

Error image
0
-180 -130 -80 -30 20 70 120 170

-0.02

Error------>

Error Histogram 11
Inference

• As error entropy is very small, entropy


coding techniques can be employed to get a
significant amount of compression.

12
What you should be able to do at this point:
1. Convert a gray-scale image into bit-plane
images.
2. Apply run-length coding on binary images.
3. State the basic principles of lossless predictive
coding.
4. Obtain predicted image and error image from
a given image and prediction scheme.
5. Reconstruct the original image from the error
image and the predicted image.
6. Compare the entropies of the original image
and the error image. 13
Assignments

1. Pick up any monochrome image from the archive.


(a) Obtain the bit-plane mapped images for all the eight bit
planes.
(b) Represent the image by a 8-bit gray code defined as follows:
g 7 b7
g i bi  bi 1 , 0 i 6
where, b7 b6 b1b0 represents the binary values. Obtain the
gray-coded bit plane images for all the eight planes.
(c) Compare the two sets of bit-plane images in (a) and (b). In
what sense should gray-coded bit-planes be better? Justify
your answer.
14
Assignments (Contd.)
2. (a) On the above bit-plane images, perform 1-D run-length
coding, as described in Section-5.2. If each run is to be
represented by a 6-bit value, calculate the compression ratio
(compressed bits: uncompressed bits) for (i) binary-mapped
bit-planes and (ii) gray-coded bit-planes.
(b) From the statistics of gray-coded bit-planes, obtain the
probabilities of the run-lengths. Assign Huffman codes to the
run-lengths and calculate the compression ratio for the
resulting encoded bit stream. Compare this result with that of
(a)-(ii).
3. (a) Using the same monochrome image, obtain the predicted
image and the error image using a1 a 2 a3 a 4 0.25 .
(b) Compute the histograms and the entropies of the original
image and the error image. 15

You might also like