Data compression

13
TOPIC’S PRESENTATION: IMAGE COMPRESSION Prepared by: SBAIH Nizar 2012/2013

Transcript of Data compression

Page 1: Data compression

TOPIC’S PRESENTATION:

IMAGE COMPRESSION

Prepared by: SBAIH Nizar 2012/2013

Page 2: Data compression

2

PLAN:

Why compression ?About digital images.Lossless data compression.Lossy data compression. Conclusion.

Page 3: Data compression

3

Why compression ?

Image with 10 Megapixel

Three color component (R,G,B).

One byte by component.

Memory occupation : 30 Mbyte by image.

Stocking on disk ? Transmission over the

network ?

Reduce its size on disk.

Speed transmission over a network.

Page 4: Data compression

4

About images

It is acquired, created, processed and stored in binary form. It is composed of a set of points called pixels.

Example: Image 1024 × 768 coded on 3 bytes Number of pixels : 1024 × 768 = 786432 pixels Image size : 1024 × 768 × 3 = 2359296 octets = 2,25 Mo

Page 5: Data compression

Performance criteria5

Compression ratio is an important factor to differ between

images :

The Mean Square Error is the cumulative squared error between the compressed and the original image :

Page 6: Data compression

Algorithm compression6

There are two types of compression:

Lossless compression : Perfect reconstruction. Statistical redundancy. Small compression ratio.Lossy compression : Reconstructed image ≠ original image. Quantization. Visually lossless. High compression ratio.

Page 7: Data compression

7

Lossless compression

There are three types of lossless compression:

•Methods based redundancy (RLE).•Statistical methods (Huffman).•Methods based on dictionaries (LZW).

Page 8: Data compression

8

Run-length encoding

Definition :

Run-length encoding is a data compression algorithm that is supported by most bitmap file formats, such as TIFF, BMP, and PCX.

Principle:

RLE works by reducing the physical size of a repeating string of characters.

Page 9: Data compression

9

Run-length encoding

Example:

AAAABBBC 4A3B1C After RLE

ENSAS 1E1N1S1A1SAfter RLE

Gain = 25% Loss = 50%

Rules for using RLE:

Rule 1 : The character must be repeated at least three times.

Rule 2 : If the sequence is not encoded, we above 00 followed by the number of characters .

Rule 3 : If the sequence is odd, we copy 00 at the end of the sequences .

Page 10: Data compression

10

Run-length encoding

There are a number of variants of run-length encoding. Image data is normally run-length encoded by uniform paving points, along lines, or even zigzag.

Different methods to encode images:

Page 11: Data compression

11

LZW (LEMPEL-ZIV-WEICH)

Definition :

It is a method of compression dictionary based on reasons that are more often than others.

Principle:

Repeated sequences are stored in a dictionary and replaced by their address in the dictionary.

The index is replaced by the sequence which is stored on a bit number smaller than the sequence.

Page 12: Data compression

12

LZW (LEMPEL-ZIV-WEICH)

Example :

Size of image : 256*153*24 bits = 114 ko

Compression LZW

The size of the image : 51,9 ko

Le taux de compression est

de 2,21

Page 13: Data compression

13

THANK’S FOR YOUR ATTENTION