Top Banner
Image Compression by Mohamed Hagras
24
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Image Compression

Image Compression

by

Mohamed Hagras

Page 2: Image Compression

2

Contents

What is Image Compression? Why Image Compression? Lossless and Lossy Techniques Bitmap Format Graphics Interchange Format Portable Network Graphics Format Tag Image File format JPEG JPEG 2000

22/05/2010 Image Compression

Page 3: Image Compression

3

Contents

Video Compression PrincipalsFramesTypes of frames• I-frames• P-frames• B-frames• PB-frames• D-frames

Conclusion

22/05/2010 Image Compression

Page 4: Image Compression

4

What is Image Compression?

A technique used to reduce the volume of information to be transmitted about an image.

22/05/2010 Image Compression

M

Width 1 Unit

M

1/2

D

Height 1 Unit

M=Number of Samples

D=Spacing Between Samples

Page 5: Image Compression

5

Why Image Compression?

Requirements may outstrip the anticipated increase of storage space and bandwidth.

For data storage and data transmission:DVDReal time applicationsPrinter

Take advantage of :Spatial redundancyTemporal redundancy (videos)

22/05/2010 Image Compression

Page 6: Image Compression

6

Lossless And Lossy Compression

Lossless Compression

Lossy Compression

Definition There is no information loss. The image can be reconstructed exactly the same as the original.

Information loss is tolerable.

e.g RLE JPEG 2000

Applications

Medical imagery Archiving

Commercial distribution (DVD). Rate constrained environment where lossless methods can not provide enough compression ratio.22/05/2010 Image Compression

Page 7: Image Compression

7

Bitmap Format

Files with .bmp extension Each pixel is represented by a fixed number

of bits (integral power of 2)

22/05/2010 Image Compression

Advantages Disadvantages Simple Widely used Relatively well

documented Free of patents

Minimum or zero compression

Page 8: Image Compression

8

Graphics Interchange Format

GIF supports transparency and interlacing Transparency is supported by specifying which pixels of

the image is unused and as such, to reuse the background color.

Interlacing creates the illusion of faster loading graphics as the image is presented to the viewer in a series of interlaced frames.

256 colors out of a palette of 224 colors are indexed.

Amongst the oldest formats available. Supports animations.22/05/2010 Image Compression

Page 9: Image Compression

9

Portable Network Graphics Format PNG Developed to improve upon and replace GIF.

Supports: 2D Interlacing Transparency Variable Color Depth

Uses Lossless Data compression method called DEFLATE.

The only Disadvantage of png is that it doesn’t support Animations.22/05/2010

A PNG image with an 8-bit transparency channel

Image Compression

The same image is overlaid onto a

checkered

background

Page 10: Image Compression

10

Tag Image File Format Developed by Aldus and Microsoft. Tags used to indicate how data is arrange

and compressed. e.g LZW/RLE compression

22/05/2010 Image Compression

Advantages Disadvantages Highly flexible and

platform independent Widely used by

scanning,faxing, word processing

capable of describing bilevel, grayscale, palette-color, and full-color image data

TIFF image can’t have more than 4GB of data

Difficult to write TIFF readers which take advantage of all its features

Page 11: Image Compression

11

JPEG

Joint Photographic Expert’s Group. International standard for photographs. Lossless/lossy. Based on the facts that :

Humans are more sensitive to lower spatial frequency components.

A large majority of useful image contents change relatively slowly across images.

22/05/2010 Image Compression

Page 12: Image Compression

12

JPEG Encoding

22/05/2010 Image Compression

Cr

YCb

QuantizationFq(u, v)

DPCM

RLC

Entropy Coding

HeaderTables

Data

CodingTables

Quant…Tables

F(u, v)

8 x 8

DCTf(i, j)

8 x 8

Zig ZagScan

Page 13: Image Compression

13

JPEG (Cont)

22/05/2010 Image Compression

Advantages Disadvantages

Compression ratios of 20:1 are easily attained.

Doesn’t support transparency.

24-bits per pixel can be used leading to better accuracy.

Doesn’t work well with sharp edges.

Progressive JPEG(interlacing)

Almost always lossy and

No target bit rate

Page 14: Image Compression

14

Comparative Analysis

22/05/2010 Image Compression

a. 256 color bmp b. gif c. jpeg253 KB 4.08 KB 10.1 KB

d. Png e. tiff6.27 K 16.2 KB

Page 15: Image Compression

15

JPEG 2000 Wavelet based image compression standard

22/05/2010 Image Compression

Compressed Image Data

Entropy Encodin

g

Quantization

Forward Transfor

m

Entropy Decodin

g

Inverse Quantizati

on

Inverse Transfor

m

Compressed Image Data

SourceImage Data

Reconstructed

Image Data

Page 16: Image Compression

16

Wavelet Transform Of An Image

Advantages:

Lossless and lossy compression.

Progressive transmission by pixel accuracy and resolution.

Region-of-Interest Coding. Random codestream

access and processing. Robustness to bit-errors. Content-based

description. Side channel spatial

information (transparency).

22/05/2010 Image Compression

Page 17: Image Compression

17

JPEG vs. JPEG 2000

22/05/2010 Image Compression

512x512 image reconstructed after compression of 0.2 bpp using JPEG and JPEG 2000 respectively

Page 18: Image Compression

18

Moving Images (Videos) Any video can be thought up of as a sequence

of digitized pictures or frames.

22/05/2010 Image Compression

Types Of Frame Coding

Intra-Frame Coding(Spatial Redundancy)

Inter-Frame Coding(Temporal

Redundancy) I-Frame P-Frame

B-Frame

JPEG algo applied to each frame independently moving JPEG or MJPEG Typical compression ratios bw 10:1 and 20:1 Not large enough to produce the needed compression ratios

Only a small portion of each frame is involved with any motion, so only info related to those segments is send

Page 19: Image Compression

1922/05/2010 Image Compression

I-Frame P-Frame B-Frame PB-Frame Each frame is

coded independently.

Y (luminance) and Cb, Cr (chrominance) matrices encoded separately using JPEG algo.

I-frames frequently used in order to tackle corruption.

N = GOP = no. of frames bw successive I-frames, range(3,12).

Encoded using a combination of either a preceding I-frame or P-frame.

No. of P-frames limited as errors propagate from one p-frame to another.

M = prediction span = no. of frames bw a P-frame and the immediately preceeding I-frame or P-frame.

Their contents are predicted using both past and future frames

Allows for occasional fast moving objects

Provides better motion estimation.

Provides highest level of compression.

As they are not involved in coding of other frames they do not propagate errors.

Two neighboring P- and B-frames are encoded as if they were a single frame.

It increases the frame rate without increasing the resulting bit rate required.

Page 20: Image Compression

20

Encoding Operation

22/05/2010 Image Compression

Page 21: Image Compression

21

D-Frame

Used in movie / video-on-demand applications.

User may wish to rewind or fast-forward the video.

This requires the compressed video to be decompressed at much higher speeds.

D-frames inserted at regular intervals throughout the stream.

By using only the encoded DC coefficients of each block of pixels in the periodically inserted D-frames, a low resolution sequence of frames is provided at much higher speeds.

22/05/2010 Image Compression

Page 22: Image Compression

22

Performance

Compression ratios for I-frames is similar to that obtained with JPEG and is typically between 10:1 and 20:1 depending on the complexity of the frame contents.

Compression ratios for P-frames and B-frames are higher and depend on the search algorithm used. Typical figures are 30:1 for P-frames and 30:1 through 50:1 for B-frames.

22/05/2010 Image Compression

Page 23: Image Compression

23

Conclusion

Every format has its own advantages and disadvantages.

Depending upon the application the appropriate format should be used.

Bmp is simple but heavy. Only redeeming feature of gif : supports

animations. Png better than the rest in overall terms. Tiff is appropriate where flexibility is needed. JPEG is good for photography. JPEG 2000 is an all encompassing standard.

22/05/2010 Image Compression

Page 24: Image Compression

Thanks For ListeninG