Image Compression

10,057 views

Published on

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.

Published in: Technology, Art & Photos
6 Comments
12 Likes
Statistics
Notes
No Downloads
Views
Total views
10,057
On SlideShare
0
From Embeds
0
Number of Embeds
9
Actions
Shares
0
Downloads
1,128
Comments
6
Likes
12
Embeds 0
No embeds

No notes for slide

Image Compression

  1. 1. B.Tech (EEE) 2007-2011 Image Compression B.Tech (6th Semester) Electrical & Electronics Engineering College Of Engineering Roorkee
  2. 2. Contents ... Image Compression Lossy Compression Lossless Compression JPEG Compression Algorithm DCT v/s DWT Applications of Image Processing Advantages /Disadvantages of Image Processing
  3. 3. What is Image Compression ?  Application of data compression on digital images  Reduce redundancy of the image data Benefits of Image Compression  Store data efficiently  Transmit data efficiently
  4. 4. Lossy Compression  Decompression retrieves data different from the original  Used to compress multimedia data  Streaming media and internet telephony Methods JPEG TIFF MNG PGF
  5. 5. Original Image Before Compression
  6. 6. Decompressed Image After Compression
  7. 7. Before Compression 186 KB 57053 26 KB 31760 After Compression Image Size Colour Used
  8. 8. Lossless Compression  Exact reconstruction of original data  Executable programs and source codes  Data loss cant be tolerated Methods JPEG 2000 GIF PNG TIFF
  9. 9. Original Image Before Compression
  10. 10. Decompressed Image After Compression
  11. 11. Before Compression 186 KB 57053 136 KB 57053 After Compression Image Size Colour Used
  12. 12. 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
  13. 13. 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
  14. 14. The JPEG Compression Algorithm  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 8x8 pixel blocks FDCT Frequency Dependent quantization Quantization Table Zig-zag scan RLE Huffman Encoding output
  15. 15. The JPEG File Structure Short name SOI Bytes 0xFFD8 Size none Name 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 DQT 0xFFDB variable size DRI 0xFFDD 2 bytes SOS 0xFFDA variable size RSTn 0xFFD0 … 0xFFD7 none APPn 0xFFEn variable size Application-specific COM EOI 0xFFFE 0xFFD9 variable size none Comment End Of Image Define Huffman Table(s) Define Quantization Table(s) Define Restart Interval Start Of Scan Restart
  16. 16. 1/7 : Divided into 8x8 blocks
  17. 17. 1/7 : Divided into 8x8 blocks
  18. 18. 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
  19. 19. 2/7 : Convert RGB to YCbCr
  20. 20. 3/7 : Downsampling ( optional )  Y is taken every pixel , and Cb,Cr are taken for a block of 2x2 pixels  MCU(minimu m coded unit) : The smallest group of data units that is coded.  Data size reduces to a half immediately
  21. 21. 4/7 : Apply DCT [ Discrete Cosine Transformation ] 2D DCT: 1D DCT:
  22. 22. 4/7 : Apply DCT [ Discrete Cosine Transformation ] Shift operations From [0, 255] To [-128, 127] DCT Result
  23. 23. 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
  24. 24. 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
  25. 25. 5/7 : Quantization DCT result Quantization Matrix Quantization result
  26. 26. 6/7 : Zigzag reordering & RLE Quantization result
  27. 27. 7/7 : Huffman encoding Values G 0 0 -1, 1 1 -3, -2, 2, 3 2 -7,-6,-5,-4,5,6,7 3 . 4 . 5 . . . . . . . . . . . . . . -32767..32767 15 Real saved values . 0,1 00, 01, 10, 11 000,001,010,011,100,101,110,111 . . . . . . . . .  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 %
  28. 28. JPEG Compression Ratio 500KB image, minimum compression 40KB image, half compression 11KB image, max compression
  29. 29. 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
  30. 30. 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
  31. 31. DWT v/s DCT Wavelet compression file size: 1861 bytes compression ratio - 105.6 JPEG compression file size: 1895 bytes compression ratio - 103.8 Source: http://www.barrt.ru/parshukov/about.htm.
  32. 32. Applications of Image Processing Computer Vision Optical Sorting Face Detection Feature Detection Augmented Reality Remote Sensing Medical Image Processing
  33. 33. Advantages/Disadvantages of Image Processing Post-processing High cost Easy Sharing Easy Retrieval Environment Friendly Multiple Use Disadvantages Advantages Easy Storage Extra Knowledge High Maintenance Standardization Shape/Size of detectors
  34. 34. Any
  35. 35. info4eee An initiative for B.Tech (EEE) Student

×