Top Banner
Image Compression Paramjeet Singh Jamwal Poonam Kanyal Rittika Mittal Surbhi Tyagi B.Tech (EEE) 2007-2011 B.Tech (6 th Semester) Electrical & Electronics Engineering College Of Engineering Roorkee
35

Image Compression

May 06, 2015

Download

Technology

Presentation given in the Seminar of B.Tech 6th Semester during session 2009-10 By Paramjeet Singh Jamwal, Poonam Kanyal, Rittitka Mittal and Surabhi Tyagi.
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

ImageCompression

Paramjeet Singh JamwalPoonam Kanyal

Rittika MittalSurbhi Tyagi

B.Tech (EEE) 2007-2011

B.Tech (6th Semester)Electrical & Electronics Engineering

College Of Engineering Roorkee

Page 2: Image Compression

Contents ...

Advantages /Disadvantages of Image Processing

Applications of Image Processing

DCT v/s DWT

JPEG Compression Algorithm

Lossless Compression

Lossy Compression

Image Compression

Page 3: Image Compression

What is Image Compression ?

Application of data compression on digital images Reduce redundancy of the image data

Store data efficiently

Transmit data efficiently

Benefits of Image Compression

Page 4: Image Compression

Lossy Compression

Decompression retrieves data different from the original

Used to compress multimedia data

Streaming media and internet telephony

Methods

JPEG TIFF MNG PGF

Page 5: Image Compression

Original Image Before Compression

Page 6: Image Compression

Decompressed Image After Compression

Page 7: Image Compression

Before Compression

Size Colour UsedImage

After Compression

186 KB

26 KB

57053

31760

Page 8: Image Compression

Lossless Compression

Exact reconstruction of original data

Executable programs and source codes

Data loss cant be tolerated

Methods

JPEG2000

GIF PNG TIFF

Page 9: Image Compression

Original Image Before Compression

Page 10: Image Compression

Decompressed Image After Compression

Page 11: Image Compression

Before Compression

Size Colour UsedImage

After Compression

186 KB

136 KB

57053

57053

Page 12: Image Compression

What is JPEG ?

Stands for Joint Photographics Experts Group

Lossy compression method

Mostly used by digital cameras & web usage

Not suited for drawing , textual and iconic graphics

Page 13: Image Compression

Basics of JPEG Compression Human vision is insensitive to high spatial frequencies

JPEG Takes advantage of this by compressing high frequencies more coarsely and storing image as frequency data

Losslessly compressed image, 150KB

JPEG compressed, 14KB

Page 14: Image Compression

The JPEG Compression Algorithm

8x8 pixelblocks

FDCT

Frequency Dependent quantization

Zig-zag scan

RLE HuffmanEncoding

Quantization Table

output

Divide image into 8x8 pixel blocks Apply 2D Fourier Discrete Cosine Transform

(FDCT) Transform Apply coarse quantization to high spatial

frequency components Compress resulting data losslessly and store

Page 15: Image Compression

The JPEG File StructureShort name Bytes Size Name

SOI 0xFFD8 none Start Of Image

SOF0 0xFFC0 variable size Start Of Frame (Baseline DCT)

SOF2 0xFFC2 variable size Start Of Frame (Progressive DCT)

DHT 0xFFC4 variable size Define Huffman Table(s)

DQT 0xFFDB variable size Define Quantization Table(s)

DRI 0xFFDD 2 bytes Define Restart Interval

SOS 0xFFDA variable size Start Of Scan

RSTn 0xFFD0 … 0xFFD7 none Restart

APPn 0xFFEn variable size Application-specific

COM 0xFFFE variable size CommentEOI 0xFFD9 none End Of Image

Page 16: Image Compression

1/7 : Divided into 8x8 blocks

Page 17: Image Compression

1/7 : Divided into 8x8 blocks

Page 18: Image Compression

2/7 : Convert RGB to YCbCr

Simple color space model: [R,G,B] per pixel

JPEG uses [Y, Cb, Cr] Model

Y (Brightness) = 0.299R + 0.587G + 0.114B

Cb (Color blueness) = -0.1687R - 0.3313G + 0.5B + 128

Cr (Color redness) = 0.5R - 0.4187G - 0.0813B + 128

Page 19: Image Compression

2/7 : Convert RGB to YCbCr

Page 20: Image Compression

3/7 : Downsampling ( optional ) Y is taken every pixel , and Cb,Cr are taken for a block of 2x2 pixels

MCU(minimum coded unit) : The smallest group of data units that is coded.

Data size reduces to a half immediately

Page 21: Image Compression

4/7 : Apply DCT [ Discrete Cosine Transformation ]

2D DCT:

1D DCT:

Page 22: Image Compression

4/7 : Apply DCT [ Discrete Cosine Transformation ]

Shift operations

From [0, 255]

To [-128, 127]

DCT Result

Page 23: Image Compression

5/7 : Quantization

Luminance Quantization Matrix Chrominance Quantization Matrix

Each DCT coefficient F(u, v) is divided by the corresponding quantizer step-size parameter Q(u, v) in the quantization matrix and rounded

to the nearest integer as

Page 24: Image Compression

5/7 : Quantization [ Quality Factor ]

Quality of the reconstructed image and the achieved compression can be controlled by a user by selecting a quality factor [ Q_JPEG ] :

Q_JPEG ranges between 1 to 100

When Q_JPEG is used, the entries in tables in previous slide is scaled by the factor alpha (α), defined as :

Q_JPEG is 100 for best reproduction

Page 25: Image Compression

5/7 : Quantization

DCT result Quantization Matrix

Quantization result

Page 26: Image Compression

6/7 : Zigzag reordering & RLE

Quantization result

Page 27: Image Compression

7/7 : Huffman encoding

RLC result:[0, -3] [0, 12] [0, 3]......EOB

After group number added:[0,2,00b] [0,4,1100b] [0,2,00b]...... EOB

First Huffman coding (i.e. for [0,2,00b] ): [0, 2, 00b] => [100b, 00b]

Input : 512 bits Output : 113 bits% Red : 22.07 %

Values G Real saved values

0-1, 1

-3, -2, 2, 3-7,-6,-5,-4,5,6,7

.

.

.

.

.

.

.

.

.-32767..32767

012345.......

15

.0,1

00, 01, 10, 11000,001,010,011,100,101,110,111

.

.

.

.

.

.

.

.

.

Page 28: Image Compression

JPEG Compression Ratio

500KB image, minimum

compression

40KB image, half

compression

11KB image, max

compression

Page 29: Image Compression

Effects of varying JPEG Compression Ratio

Uncompressed image Half compression,Blurring around sharp

edges

Max compression, 8-pixel blocks apparent, large distortion in high-

frequency areas

Page 30: Image Compression

DWT v/s DCT

Images containing sharp edges/continuous curves

Uses more optimal set of functions to represent sharp edges

Wavelets are finite in extent Different families of wavelets

Page 31: Image Compression

DWT v/s DCT

Wavelet compressionfile size: 1861 bytescompression ratio - 105.6

JPEG compression file size: 1895 bytescompression ratio - 103.8

Source: http://www.barrt.ru/parshukov/about.htm.

Page 32: Image Compression

Applications of Image Processing

Computer Vision

Optical Sorting

Face Detection

Feature Detection

Augmented Reality

Remote Sensing

Medical Image Processing

Page 33: Image Compression

Advantages/Disadvantages of Image ProcessingAdvantages

Post-processing

Easy Storage

Easy Sharing

Easy Retrieval

Environment Friendly

Multiple Use

DisadvantagesHigh cost

Extra Knowledge

High Maintenance

Standardization

Shape/Size of detectors

Page 34: Image Compression

Any

QUESTIONS ?

THE END !!!

Page 35: Image Compression

info4eeeAn initiative for B.Tech (EEE) Student

FOR MORE

INFORMATION FOR ELECTRICAL & ELECTRONICS ENGINEERING

VISIT

INFO4EEE.WEEBLY.COM