Image compression
description
Transcript of Image compression
![Page 1: Image compression](https://reader035.fdocuments.net/reader035/viewer/2022062221/56813b5d550346895da454fe/html5/thumbnails/1.jpg)
IMAGE COMPRESSION
![Page 2: Image compression](https://reader035.fdocuments.net/reader035/viewer/2022062221/56813b5d550346895da454fe/html5/thumbnails/2.jpg)
Image Compression• Why?
• Reducing transportation times• Reducing file size
• A two way event - compression and decompression
![Page 3: Image compression](https://reader035.fdocuments.net/reader035/viewer/2022062221/56813b5d550346895da454fe/html5/thumbnails/3.jpg)
![Page 4: Image compression](https://reader035.fdocuments.net/reader035/viewer/2022062221/56813b5d550346895da454fe/html5/thumbnails/4.jpg)
Compression categories• Compression = Image coding• Still-image compression• Compression of moving image
![Page 5: Image compression](https://reader035.fdocuments.net/reader035/viewer/2022062221/56813b5d550346895da454fe/html5/thumbnails/5.jpg)
INTERFRAME and INTRAFRAME PROCESSING
Interframe ProcessingPredictive Encoding
Point to Point
Line to Line
Intraframe
Processing
![Page 6: Image compression](https://reader035.fdocuments.net/reader035/viewer/2022062221/56813b5d550346895da454fe/html5/thumbnails/6.jpg)
Group discussion
Discuss, which compression and coding method you know!
![Page 7: Image compression](https://reader035.fdocuments.net/reader035/viewer/2022062221/56813b5d550346895da454fe/html5/thumbnails/7.jpg)
Image compression meters• Compress ratio =
Original image size
Compressed image size
• The larger the compression ratio, the smaller the result image
![Page 8: Image compression](https://reader035.fdocuments.net/reader035/viewer/2022062221/56813b5d550346895da454fe/html5/thumbnails/8.jpg)
Image compression• Compression method is not same as the image file-
interchange format. • Example TIFF -file format supports several compression methods
![Page 9: Image compression](https://reader035.fdocuments.net/reader035/viewer/2022062221/56813b5d550346895da454fe/html5/thumbnails/9.jpg)
![Page 10: Image compression](https://reader035.fdocuments.net/reader035/viewer/2022062221/56813b5d550346895da454fe/html5/thumbnails/10.jpg)
Why Can We Compress?• Spatial redundancy
• Neighboring pixels are not independent but correlated
• Temporal redundancy
![Page 11: Image compression](https://reader035.fdocuments.net/reader035/viewer/2022062221/56813b5d550346895da454fe/html5/thumbnails/11.jpg)
Information vs Data
REDUNDANTDATA
INFORMATION
DATA = INFORMATION + REDUNDANT DATA
![Page 12: Image compression](https://reader035.fdocuments.net/reader035/viewer/2022062221/56813b5d550346895da454fe/html5/thumbnails/12.jpg)
Image compression fundamentals • Same compression method is not to be used more than
once. • But you can use different methods at the same time,
especially different lossless methods like LZW and PKZIP
![Page 13: Image compression](https://reader035.fdocuments.net/reader035/viewer/2022062221/56813b5d550346895da454fe/html5/thumbnails/13.jpg)
Image compression: symmetry
![Page 14: Image compression](https://reader035.fdocuments.net/reader035/viewer/2022062221/56813b5d550346895da454fe/html5/thumbnails/14.jpg)
Color image compression• RGB - apply the same compression scheme to the
three color component images• Convert the image from the RGB color space to a less
redundant space, because RGB components carries a lot of same information.
• RGB --> HSB, when Hue and Saturation components are well compressed
![Page 15: Image compression](https://reader035.fdocuments.net/reader035/viewer/2022062221/56813b5d550346895da454fe/html5/thumbnails/15.jpg)
Color imagecompression
RED
GREEN
BLUE
SATURATION
HUE
BRIGHTNESS
![Page 16: Image compression](https://reader035.fdocuments.net/reader035/viewer/2022062221/56813b5d550346895da454fe/html5/thumbnails/16.jpg)
Lossless image compression• Image can be decompressed back to original• Used when image’s future purpose of use is not known,
example space exploration imagery is often studied for years following its origination
![Page 17: Image compression](https://reader035.fdocuments.net/reader035/viewer/2022062221/56813b5d550346895da454fe/html5/thumbnails/17.jpg)
Run-Length Coding
76 76 76 76 76 78 79 79 80 80 80 98 98y
76| 5 78| 1 79| 2 80| 3 98| 2
Run-Length Codes(Brightness | Run-length)
x
![Page 18: Image compression](https://reader035.fdocuments.net/reader035/viewer/2022062221/56813b5d550346895da454fe/html5/thumbnails/18.jpg)
Run-length coding• Codes the nearby pixels which has same brightness
values in two values - Run-Length, RLE and brightness value
• Error sensitive • Data explosion• Data errors
![Page 19: Image compression](https://reader035.fdocuments.net/reader035/viewer/2022062221/56813b5d550346895da454fe/html5/thumbnails/19.jpg)
Huffman or Entropy Coding
Converting the pixel brightness values in the original image to new variable-length codes, based on their frequency of occurrence in the image
Arrange valuesin descending frequency of occurrence
BrightnessHistogram
Assign Huffmanvariable-lengthcodes
Raw ImageData
98,100,103,87,86,95...
SubstituteHuffmancodes
Appendcodelist
Huffman CodeImage Data
0,10,0,11001111,11011
The flow of the Huffman coding operation.
![Page 20: Image compression](https://reader035.fdocuments.net/reader035/viewer/2022062221/56813b5d550346895da454fe/html5/thumbnails/20.jpg)
Lossless or Lossy Compression• Lossless compression
• There is no information loss, and the image can be reconstructed exactly the same as the original
• Applications: Medical imagery, Archiving
• Lossy compression• Information loss is tolerable
• Many-to-1 mapping in compression eg. quantization• Applications: commercial distribution (DVD, Blueray,
WWW) and rate constrained environment where lossless methods can not provide enough compression ratio
![Page 21: Image compression](https://reader035.fdocuments.net/reader035/viewer/2022062221/56813b5d550346895da454fe/html5/thumbnails/21.jpg)
Predictive Coding
• Based on the assumption that pixel’s brightness can be predicted based on the brightness of the preceding pixel
• Codes only the brightness value of the pixel next to each other
• DPCM (Differential Pulse Code Modulation)
![Page 22: Image compression](https://reader035.fdocuments.net/reader035/viewer/2022062221/56813b5d550346895da454fe/html5/thumbnails/22.jpg)
DPCM (Differential Pulse Code Modulation)
![Page 23: Image compression](https://reader035.fdocuments.net/reader035/viewer/2022062221/56813b5d550346895da454fe/html5/thumbnails/23.jpg)
Block Coding• Searching for repeated patterns (mostly in rows)• Pixel patterns are put in Codebook• Original image’s pixel pattern is replaced by codebook
index in compressed image
![Page 24: Image compression](https://reader035.fdocuments.net/reader035/viewer/2022062221/56813b5d550346895da454fe/html5/thumbnails/24.jpg)
Block Coding
• LZW- compression (Lempel-Ziv-Welch)• Compression ratio 2:1 - 3:1• Starting with a 256 single-pixel long codebook ->
adding until it reaches its maximum length • LZW+Huffmann, where most common pixel patterns
get shortest codes
![Page 25: Image compression](https://reader035.fdocuments.net/reader035/viewer/2022062221/56813b5d550346895da454fe/html5/thumbnails/25.jpg)
TRANSFORM CODING
• Transform Coding
- transform image
- code the coefficients of the transform
- transmit them
- reconstruct by inverse transform
• Benefits
- transform coeff. relatively uncorrelated
- energy is highly compacted
- reasonable robust relative to
channel errors
![Page 26: Image compression](https://reader035.fdocuments.net/reader035/viewer/2022062221/56813b5d550346895da454fe/html5/thumbnails/26.jpg)
Transform Coding– A form of lossy block coding, but it does
not use codebook– Frequency domain– Frequency transformation finds the
essential data in the image and coding is accurate
– 8*8 pixel blocks– Discrete Cosine Transform (DCT)
![Page 27: Image compression](https://reader035.fdocuments.net/reader035/viewer/2022062221/56813b5d550346895da454fe/html5/thumbnails/27.jpg)
Why Do We Need International Standards?
• International standardization is conducted to achieve inter-operability .• Only syntax and decoder are specified.• Encoder is not standardized and its optimization is left to the
manufacturer.
• Standards provide state-of-the-art technology that is developed by a group of experts in the field.• Not only solve current problems, but also anticipate the future
application requirements.
![Page 28: Image compression](https://reader035.fdocuments.net/reader035/viewer/2022062221/56813b5d550346895da454fe/html5/thumbnails/28.jpg)
Compression standards: JPEG
Joint Photographic Experts Group (JPEG)
• One of the most important image data compression standards
• Developed for highly detailed gray-scale and color images / photographs
• Most commonly used as a lossy image compression method, but lossless modes exist as well
• JPEG uses several cascaded compression modes
• Adjustable compression scheme number of retained frequency components can be changed to
achieve different compression ratios • DCT > Remove rare frequency components >
DPCM/RLE > Huffman
![Page 29: Image compression](https://reader035.fdocuments.net/reader035/viewer/2022062221/56813b5d550346895da454fe/html5/thumbnails/29.jpg)
JPEG(Intraframe coding)
• First generation JPEG uses DCT+Run length Huffman entropy coding.
• Second generation JPEG (JPEG2000) uses wavelet transform + bit plane coding + Arithmetic entropy coding.
![Page 30: Image compression](https://reader035.fdocuments.net/reader035/viewer/2022062221/56813b5d550346895da454fe/html5/thumbnails/30.jpg)
Why DCT Not DFT?
• DCT is similar to DFT, but can provide a better approximation with fewer coefficients
• The coefficients of DCT are real valued instead of complex valued in DFT.
![Page 31: Image compression](https://reader035.fdocuments.net/reader035/viewer/2022062221/56813b5d550346895da454fe/html5/thumbnails/31.jpg)
The 64 (8 X 8) DCT Basis Functions
• Each 8x8 block can be looked at as a weighted sum of
these basis functions.
• The process of 2D DCT is also the
process of finding those weights.
![Page 32: Image compression](https://reader035.fdocuments.net/reader035/viewer/2022062221/56813b5d550346895da454fe/html5/thumbnails/32.jpg)
Zig-zag Scan DCT Blocks
• Why? -- To group low frequency coefficients in top of vector.
• Maps 8 x 8 to a 1 x 64 vector.
![Page 33: Image compression](https://reader035.fdocuments.net/reader035/viewer/2022062221/56813b5d550346895da454fe/html5/thumbnails/33.jpg)
Original
![Page 34: Image compression](https://reader035.fdocuments.net/reader035/viewer/2022062221/56813b5d550346895da454fe/html5/thumbnails/34.jpg)
JPEG
27:1
![Page 35: Image compression](https://reader035.fdocuments.net/reader035/viewer/2022062221/56813b5d550346895da454fe/html5/thumbnails/35.jpg)
JPEG2000
27:1
![Page 36: Image compression](https://reader035.fdocuments.net/reader035/viewer/2022062221/56813b5d550346895da454fe/html5/thumbnails/36.jpg)
Motion compression standards
Moving Picture Experts Group (MPEG)• Intended for the mass distribution of motion video
sequences• Compression-asymmetric = compression techniques
require more processing time and computing power than the decompression ones
• In addition to coding techniques used with JPEG, MPEG utilizes interframe coding methods
MPEG-1 use CD-ROM and Internet MPEG-2 use DVD and Digi-TV MPEG-4 most advanced technology (Blueray,
www)