JPEG Image Compression
JPEG Image Compression
JPEG: Joint Photographic Experts Group. JPEG: compression algorithm, NOT a file format. The original JPEG format was JFIF and later SPIFF. Current popular choices include CCube JFIF; Adobe TIFF/JPEG. 4-step process: 1. Transforming RGB to YIQ/YUV, separating intensity from color 2. Identifying redundant data using a Discrete Cosine Transformation (DCT) 3. Quantizing remaining data 4. Encoding the result to minimize storage requirements
1/30/2004
1/30/2004
1/30/2004
1/30/2004
1/30/2004
1/30/2004
1/30/2004
Lossless Coding
Lossless compression is possible because there is significant redundancy in images. Examples of redundancy: spatial correlation among neighboring pixels in still imagery, temporal correlation in video. In lossless compression decoded image is identical to original encoded image.
Input Image
Bitstream
Transformation
Data-to-Symbol Mapping
1/30/2004
10
Data-to-Symbol Mapping
Mapping data into symbols Run-length coding (RLC): maps a sequence of numbers into a sequence of symbol pairs (run,value). 11111000110101000000 ----RLC----> (5,1)(3,0)(2,1)(1,0)(1,1)
1/30/2004
11
Huffman Coding
Premise: 1) if P(sk)>P(sj) then lk<lj. 2) With symbols listed in order of decreasing probabilities the last two symbols are assigned codewords that have the same length and differ in their final bit only.
1/30/2004
14
Huffman Coding
Ranking symbol probabilities
1/30/2004
15
Huffman Coding
1/30/2004
16
Huffman Coding
1/30/2004
17
Huffman Coding
1/30/2004
18
1/30/2004
20
Compression performance
JPEG: 10:1 to 20:1 compression without visible loss (effective storage requirement drops to 1-2 bits/pixel) 30:1 to 50:1 compression with small to moderate visual deterioration 100:1 compression for low quality applications GIF: 3:1 compression by reducing color space to 8 bits LZW coding may improve compression up to 5:1
1/30/2004
21
Argument: the requires 5 bytes (80 bits) to encode by assigning a single symbol to it we can express it with 9 bits
1/30/2004
22