1 / 28

Understanding JPEG Compression: Comparison, Structure, and Techniques

Learn about JPEG compression, including its comparison to other formats, the structure of JPEG files, and the techniques used for compression. Understand the reasons why JPEG is widely used and its impact on image quality.

laurenburns
Télécharger la présentation

Understanding JPEG Compression: Comparison, Structure, and Techniques

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 2006134009 Ganbat OIP Lab 2006-12-05

  2. What is JPEG? Comparison Why ? Base line JPEG Structure of JPEG file Jpeg to BMP

  3. Joint Photographic Expert Group(1987) CCITT(International Telegraph and Telephone Consultative Committee)(1986) Fax 24 bits/pixel (16 million colors)

  4. JPG=4 KB GIF=22 KB GIF=5 KBJPG [15%]JPG [60% ] 6 KB4 KB

  5. Compression rate • GIF 4:1-10:1 • JPEG 5:1-10:1 20:1-40:1 • Color • JPEG 24bit/pixel • GIF 256 color • Size

  6. Partition to 8x8 blocks DCT Quantization Zigzag Huffman Coding Change the color model Compressed JPEG image Headers Data Decoded Image

  7. The human eye is not as sensitive to high frequencychrominance (color) components as it is to luminance (intensity) components. The brightness and color information in an image areseparated. Y component represents the color intensity of theimage (equivalent to a black and white televisionsignal). U and V represent the relative redness and bluenessof the image. YUV (YCrCb) Color Space. Y = 0.299R + 0.587G + 0.114B U = -0.1687R -0.3313G + 0.5B + 128 V = 0.5R – 0.4187G – 0.0813B + 128 R = Y + 1.402V G = Y – 0.34414(U – 128) – 0.71414(V – 128) B = Y + 1.722(U – 128)

  8. Due to the human vision is not sensitive to the chrominance domain, we can apply the subsampling filter to reduce the data size.

  9. From spatial domain to frequency domain:

  10. F'[u, v] = round ( F[u, v] / q[u, v] ). Why? -- To reduce number of bits per sample Example: 101101 = 45 (6 bits). q[u, v] = 4 --> Truncate to 4 bits: 1011 = 11. The Luminance Quantization Table q(u, v)                 The Chrominance Quantization Table q(u, v)

  11. Quantization error is the main source of the Lossy Compression.

  12. Why? -- to group low frequency coefficients in top of vector. Maps 8 x 8 to a 1 x 64 vector −26,−3, 0,−3, −2, −6,2, −4, 1, −4,1, 1, 5, 1, 2,−1, 1, −1, 2, 0, 0,0, 0, 0, −1, −1, 0, 0,0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0,0, 0, 0, 0,0, 0, 0,0, 0,0

  13. −26,−3, 0,−3, −2, −6,2, −4, 1, −4,1, 1, 5, 1, 2,−1, 1, −1, 2, 0, 0,0, 0, 0, −1, −1, 0, 0,0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0,0, 0, 0, 0,0, 0, 0,0, 0,0 Variable-length encoding technique Tree structure Binary tree −26,−3, 0,−3, −2, −6,2, −4, 1, −4,1, 1, 5, 1, 2,−1, 1, −1, 2, 0, 0,0, 0, 0, −1, −1, EOB

  14. A=1 C=01 B=001 D=0001 E=0000 ASCII code A=01000001 B=01000010 C=01000011 D=01000100 E=01000101 17 0 11 0 1 7 1 0 4 1 0 1 E D B C A 2 2 3 4 6 http://www.cs.auckland.ac.nz/software/AlgAnim/huffman.html

  15. Huffman • 001011 HUFFMAN DECODING 0 1 1 0 1 0 1 E D B C A BCA ASCII code 01000010 01000011 01000001 B C A

  16. Start of Image • SOI: (16 bits) Start of image is given by SOI(0xFFD8)

  17. SOF(FFC0) Lf: (16 bit) Frame header length in bytes. P: (8 bit) Bits/Sample precision. Y: (16 bit) Number of lines in the source image (Height). X: (16 bit) Number of samples in one line(Width). Nf: (8 bit) Number of image component in the frame. C1: (8 bit) Component identifier label. H1: (4 bit) Horizontal sampling factor. V1: (4 bit) Vertical sampling factor. Tq1: (8 bit) Quantization table destination selector.

  18. DQT (16bit) 0xFFDB Lq: (16bit) Quantization Table Length Pq: (4bit ) table element Qk’s precision. ‘0’=8bit, ‘1’=16bit . Tq: (4 bit) Quantization table destination identifier. Qk: (8 bit) Quantization table elements in zig-zag scan order.

  19. Luminance Chrominance Define Quantization Table Length: 67 Table Index: 0 Table Precision: 0 Table Values: 08 06 06 07 06 05 08 07 07 07 09 09 08 0A 0C 14 0D 0C 0B 0B 0C 19 12 13 0F 14 1D 1A 1F 1E 1D 1A 1C 1C 20 24 2E 27 20 22 2C 23 1C 1C 28 37 29 2C 30 31 34 34 34 1F 27 39 3D 38 32 3C 2E 33 34 32 Table Index Precision Table length Q1 Q64

  20. DHT (16 bit) The define Human table symbol is 0xFFC4. Lh: (16 bit) Human table definition length Tc: (4 bit) Table class, 0 = DC table, 1 = AC table Th: (4 bit) Human table destination identifier Li: (8 bit) Number of Human codes of length i. (1 <i< 16) Vi;j : (8bit) Value associated with each Human code.

  21. Luminance DC Chrominance DC Luminance AC Chrominance AC Length: 31(001F) Table class: DC(0 ) Table Index: 0 Number of Human codes of length 00 01 05 01 01 01 01 01 01 00 00 00 00 00 00 00 Value associated with each Human code 01 02 03 04 05 06 07 08 09 0A 0B

  22. SOS (16 bit) Start scan segment code given by 0xFFDA. Ls: (16 bit) Scan header length. Ns: (8 bit) Number of image components in this scan segment. Csj : (8 bit) scan component selector. Tdj : (4 bit) DC Human table destination selector. Taj : (4 bit) AC Human table destination selector. Ss: (8 bit) Start of spectral selection. Specify thefirst DCT coefficient in zig-zag order,tobe coded. Se: (8 bit) End of spectral selection. Specify the last DCT coefficient in zig-zag order, tobe coded. Ah: (4 bit) Set to zero in Sequential DCT. Al: (4 bit) Set to zero in Sequential DCT.

  23. Length: 12 Scan Count: 3 Component ID: 1 AC Entropy Table: 0 DC Entropy Table: 0 Component ID: 2 AC Entropy Table: 1 DC Entropy Table: 1 Component ID: 3 AC Entropy Table: 1 DC Entropy Table: 1 Spectral Selection Start: 0 Spectral Selection End: 63

  24. JPEG to BMP RB.JPG Image.bmp

  25. Thank you Q&A

More Related