Beruflich Dokumente
Kultur Dokumente
Image Compression
Types of Data
Compression Scheme
Compression Measures
Types of Compression
Lossless Vs Lossy
Types of Redundancy
Coding Redundancy
Interpixel Redundancy
Psychovisual Redundancy
Vertical Scanning
2D RLC
Make-up Code
2D RLC
Huffman Coding
Example
Bitplane Coding
Bitplane coding
Arithmetic Coding
Decoding
Dictionary Based
Compression
LZW Algorithm
W = NIL;
while (there is input){
K = next symbol from input;
if (WK exists in the dictionary) {
W = WK;
} else {
output (index(W));
add WK to the dictionary;
W = K;
}
}
START
YES
STOP
IS EOF
?
NO
K=NEXT INPUT
YES
W=WK
IS WK
FOUND?
NO
OUTPUT INDEX OF W
ADD WK TO DICTIONARY
W=K
Input string is
The Initial
Dictionary
contains
symbols like
a, b, c, d with
their index
values as 1,
2, 3, 4
respectively.
Now the input
string is read
from left to
right.
Starting from
a.
a b d c a d a c
a
b
c
d
1
2
3
4
W = Null
K=a
WK = a
In the
dictionary.
a b d c a d a c
K
a
b
c
d
1
2
3
4
K = b.
WK = ab
is not in the
dictionary.
Add WK to
dictionary
Output code
for a.
Set W = b
a b d c a d a c
K
1
a
b
c
d
1 a
2 b
3
4
K=d
WK = bd
Not in the
dictionary.
Add bd to
dictionary.
Output code
b
Set W = d
a b d c a d a c
K
1 2
a
b
c
d
1
2
3
4
a
b
d
5
6
K=a
WK = da
not in the
dictionary.
Add it to
dictionary.
Output code
d
Set W = a
a b d a b d a c
K
1 2 4
a
b
c
d
1
2
3
4
a
b
d
a
5
6
7
K=b
WK = ab
It is in the
dictionary.
a b d a b d a c
K
1 2 4
a
b
c
d
1
2
3
4
a
b
d
a
5
6
7
K=d
WK = abd
Not in the
dictionary.
Add W to the
dictionary.
Output code
for W.
Set W = d
a b d a b d a c
K
1 2 4 5
a
b
c
d
1
2
3
4
a
b
d
a
ab
d
5
6
7
8
K=a
WK = da
In the dictionary.
a b d a b d a c
K
1 2 4 5
a
b
c
d
1
2
3
4
a
b
d
a
ab
d
5
6
7
8
K=c
WK = dac
Not in the dictionary.
Add WK to the
dictionary.
Output code for W.
Set W = c
No input left so
output code for W.
a b d a b d a c
K
1 2 4 5 7
a
b
c
d
1
2
3
4
a
b
d
a
ab
d
5 da 9
6 c
7
8
a b d a b d a c
K
1
a
b
c
d
1 ab 5
2 bd 6
3 da 7
4 abd 8
7 3
dac
START
NO
K=NEXT INPUT
ENTRY=DICTIONARY INDEX (K)
Output ENTRY
ADD W+ENTRY[0] TO DICTIONARY
W=ENTRY
STOP
K=1
Out put K (i.e. a)
W=K
a
a
b
c
d
1
2
3
4
K=2
entry = b
Output entry
Add W + entry[0] to
dictionary
W = entry[0] (i.e. b)
a b
a
b
c
d
1
2
3
4
ab
K=4
entry = d
Output entry
Add W + entry[0] to
dictionary
W = entry[0] (i.e. d)
a b d
a
b
c
d
1 ab
2 bd
3
4
5
6
K=5
entry = ab
Output entry
Add W + entry[0] to
dictionary
W = entry[0] (i.e. a)
5
K
a b d a b
a
b
c
d
1 ab
2 bd
3 da
4
5
6
7
K=7
entry = da
Output entry
Add W + entry[0] to
dictionary
W = entry[0] (i.e. d)
a b d a b d a
a
b
c
d
1 ab 5
2 bd 6
3 da 7
4 abd 8
K=3
entry = c
Output entry
Add W + entry[0] to
dictionary
W = entry[0] (i.e. c)
3
K
a b d a b d a c
a
b
c
d
1 ab 5
2 bd 6
3 da 7
4 abd 8
dac
Advantages
Lossy Compression
Methods
In order to achieve high compression ratios with complex
images, lossy compression methods are required.
Lossy compression provides trade-offs between image
quality and file reduction size.
With some of the more advanced methods, images can be
compressed 10 to 20 times with virtually no visible
information loss, and 30 to 50 times with minimal
degradation.
Lossy Compression
- Example
Lossy Compression
- Methods
Filtering
JPEG algorithm
Model-based
Why Lossy?
In most applications related to
consumer electronics, lossless
compression is not necessary
What we care is the subjective quality of
the decoded image, not those intensity
values
Delta Modulation
Vector Quantization
Codebook Construction
BTC
Bit Allocation
Zonal Coding
Threshold Mask
Sequential DCT
Lossless Mode
Progressive Encoding
The main idea of progressive
encoding is a gradual compression
using the priority of the pixels. First it
sends the coarse version of the
image to the receiver. Then the
additional information is sent so that
the quality of the image is
progressively refined.
Hierarchical Mode
This scheme uses the pyramidal data
structure that stores the image at
several different resolutions.
Summary
Summary