Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of...

95
Image Compression (Chapter 8)
  • date post

    20-Dec-2015
  • Category

    Documents

  • view

    237
  • download

    1

Transcript of Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of...

Page 1: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Image Compression (Chapter 8)

Page 2: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Introduction

• The goal of image compression is to reduce the amount of data required to represent a digital image.

• Important for reducing storage requirements and improving transmission rates.

Page 3: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Approaches

• Lossless– Information preserving– Low compression ratios– e.g., Huffman

• Lossy– Does not preserve information– High compression ratios– e.g., JPEG

• Tradeoff: image quality vs compression ratio

Page 4: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Data vs Information

• Data and information are not synonymous terms!

• Data is the means by which information is conveyed.

• Data compression aims to reduce the amount of data required to represent a given quantity of information while preserving as much information as possible.

Page 5: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Data vs Information (cont’d)

• The same amount of information can be represented by various amount of data, e.g.:

Your wife, Helen, will meet you at Logan Airport in Boston at 5 minutes past 6:00 pm tomorrow night

Your wife will meet you at Logan Airport at 5 minutes past 6:00 pm tomorrow night

Helen will meet you at Logan at 6:00 pm tomorrow night

Ex1:

Ex2:

Ex3:

Page 6: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Data Redundancy

• Data redundancy is a mathematically quantifiable entity!

compression

Page 7: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Data Redundancy (cont’d)

• Compression ratio:

• Relative data redundancy:

Example:

Page 8: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Types of Data Redundancy

(1) Coding redundancy

(2) Interpixel redundancy

(3) Psychovisual redundancy

• The role of compression is to reduce one or more of these redundancy types.

Page 9: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Coding Redundancy

• Data compression can be achieved using an appropriate encoding scheme.

Example: binary encoding

Page 10: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Encoding Schemes

• Elements of an encoding scheme:– Code: a list of symbols (letters, numbers, bits etc.)

– Code word: a sequence of symbols used to represent a piece of information or an event (e.g., gray levels)

– Code word length: number of symbols in each code word

Page 11: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Definitions

• In an MxN gray level image• Let be a discrete random variable representing the gray levels in an • image. Its probability is represented by

Page 12: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Constant Length Coding

• l(rk) = c which implies that Lavg=c

Example:

Page 13: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Avoiding Coding Redundancy

• To avoid coding redundancy, codes should be selected according to the probabilities of the events.

• Variable Length Coding– Assign fewer symbols (bits) to the more probable events (e.g.,

gray levels for images)

Page 14: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Variable Length Coding

• Consider the probability of the gray levels:

variable length

Page 15: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Interpixel redundancy

• This type of redundancy – sometimes called spatial redundancy, interframe redundancy, or geometric redundancy – exploits the fact that an image very often contains strongly correlated pixels, in other words, large regions whose pixel values are the same or almost the same.

Page 16: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Interpixel redundancy

• Interpixel redundancy implies that any pixel value can be reasonably predicted by its neighbors (i.e., correlated).

Page 17: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Interpixel redundancy

• This redundancy can be explored in several ways, one of which is by predicting a pixel value based on the values of its neighboring pixels.

• In order to do so, the original 2-D array of pixels is usually mapped into a different format, e.g., an array of differences between adjacent pixels.

• If the original image pixels can be reconstructed from the transformed data set the mapping is said to be reversible.

Page 18: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Interpixel redundancy (cont’d)

• To reduce interpixel redundnacy, the data must be transformed in another format (i.e., through mappings)– e.g., thresholding, or differences between adjacent pixels, or DFT

• Example:

original

binary

(profile – line 100)

threshold

Page 19: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Psychovisual redundancy

• Takes into advantage the peculiarities of the human visual system.

• The eye does not respond with equal sensitivity to all visual information.

• Humans search for important features (e.g., edges, texture, etc.) and do not perform quantitative analysis of every pixel in the image.

Page 20: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Psychovisual redundancy (cont’d)Example: Quantization

256 gray levels 16 gray levelsimproved gray-scale quantization16 gray levels

8/4 =2:1

i.e., add to each pixel apseudo-random numberprior to quantization(IGS)

Page 21: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Fidelity Criteria

• How close is to ?

• Criteria– Subjective: based on human observers – Objective: mathematically defined criteria

Page 22: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Subjective Fidelity Criteria

Page 23: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Objective Fidelity Criteria

• Root mean square error (RMS)

• Mean-square signal-to-noise ratio (SNR)

Page 24: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Example

originalRMS=5.17 RMS=15.67 RMS=14.17

Page 25: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Image Compression Model

Page 26: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Image Compression Model (cont’d)

• Mapper: transforms the input data into a format that facilitates reduction of interpixel redundancies.

Page 27: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Image Compression Model (cont’d)

• Quantizer: reduces the accuracy of the mapper’s output in accordance with some pre-established fidelity criteria.

Page 28: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Image Compression Model (cont’d)

• Symbol encoder: assigns the shortest code to the most frequently occurring output values.

Page 29: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Image Compression Models (cont’d)

• The inverse operations are performed.

• But … quantization is irreversible in general.

Page 30: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

•As the output of the source encoder contains little redundancy it would be highly sensitive to transmission noise.• Channel Encoder is used to introduce redundancy in a controlled fashion when the channel is noisy.

Example: Hamming code

The Channel Encoder and Decoder

Page 31: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

It is based upon appending enough bits to the data being encoded to ensure that some minimum number of bits must change between valid code words.The 7-bit hamming (7,4) code word h1…..h7

The Channel Encoder and Decoder

Page 32: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

The Channel Encoder and Decoder

• Any single bit error can be detected and corrected

• any error indicated by non-zero parity word c4,2,1

Page 33: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

How do we measure information?

• What is the information content of a message/image?

• What is the minimum amount of data that is sufficient to describe completely an image without loss of information?

Page 34: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Modeling the Information Generation Process

• Assume that information generation process is a probabilistic process.

• A random event E which occurs with probability P(E) contains:

Page 35: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

How much information does a pixel contain?

• Suppose that the gray level value of pixels is generated by a random variable, then rk contains

units of information

Page 36: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

• Entropy: the average information content of an image

units/pixel

1

0

( ) Pr( )L

k kk

E I r r

using

Average information of an image

we have:

Assumption: statistically independent random events

Page 37: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

• Redundancy:

Modeling the Information Generation Process (cont’d)

where:

Page 38: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Entropy Estimation

• Not easy!

image

Page 39: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Entropy Estimation

• First order estimate of H:

Page 40: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Estimating Entropy (cont’d)

• Second order estimate of H:– Use relative frequencies of pixel blocks :

image

Page 41: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Estimating Entropy (cont’d)

• Comments on first and second order entropy estimates:

– The first-order estimate gives only a lower-bound on the compression that can be achieved.

– Differences between higher-order estimates of entropy and the first-order estimate indicate the presence of interpixel redundancies.

Page 42: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Estimating Entropy (cont’d)• E.g., consider difference image:

Page 43: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Estimating Entropy (cont’d)• Entropy of difference image:

• Better than before (i.e., H=1.81 for original image), however, a better transformation could be found:

Page 44: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Lossless Compression

• Huffman, Golomb, Arithmetic coding redundancy

• LZW, Run-length, Symbol-based, Bit-plane interpixel redundancy

Page 45: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Huffman Coding (i.e., removes coding redundancy)

• It is a variable-length coding technique.• It creates the optimal code for a set of source symbols.• Assumption: symbols are encoded one at a time!

Page 46: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Huffman Coding (cont’d)

• Optimal code: minimizes the number of code symbols per source symbol.

• Forward Pass1. Sort probabilities per symbol2. Combine the lowest two

probabilities3. Repeat Step2 until only two probabilities remain.

Page 47: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Huffman Coding (cont’d)• Backward Pass

Assign code symbols going backwards

Page 48: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Huffman Coding (cont’d)

• Lavg using Huffman coding:

• Lavg assuming binary codes:

Page 49: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Huffman Coding (cont’d)

• Comments– After the code has been created, coding/decoding can be

implemented using a look-up table.

– Decoding can be done in an unambiguous way !!

Page 50: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Arithmetic (or Range) Coding (i.e., removes coding redundancy)

• No assumption on encoding symbols one at a time.– No one-to-one correspondence between source and code

words.

• Slower than Huffman coding but typically achieves better compression.

• A sequence of source symbols is assigned a single arithmetic code word which corresponds to a sub-interval in [0,1]

Page 51: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Arithmetic Coding (cont’d)

• As the number of symbols in the message increases, the interval used to represent it becomes smaller.– Each symbol reduces the size of the interval according to its

probability.

• Smaller intervals require more information units (i.e., bits) to be represented.

Page 52: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Arithmetic Coding (cont’d)

Encode message: a1 a2 a3 a3 a4

0 1

1) Assume message occupies [0, 1)

2) Subdivide [0, 1) based on the probabilities of αi

3) Update interval by processing source symbols

Page 53: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Example

a1 a2 a3 a3 a4

[0.06752, 0.0688) or, 0.068

Page 54: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Example

• The message a1 a2 a3 a3 a4 is encoded using 3 decimal digits or 0.6 decimal digits per source symbol.

• The entropy of this message is:

Note: Finite precision arithmetic might cause problems due to truncations!

-(3 x 0.2log10(0.2)+0.4log10(0.4))=0.5786 digits/symbol

Page 55: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

1.0

0.8

0.4

0.2

0.8

0.72

0.56

0.48

0.40.0

0.72

0.688

0.624

0.592

0.592

0.5856

0.5728

0.5664a3 a3 a1 a2 a4

0.5728

0.57152

056896

0.56768

0.56 0.56 0.5664

Decode 0.572

Arithmetic Coding (cont’d)

a1

a2

a3

a4

Page 56: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

LZW Coding(i.e., removes inter-pixel redundancy)

• Requires no priori knowledge of probability distribution of pixels

• Assigns fixed length code words to variable length sequences

• Patented Algorithm US 4,558,302

• Included in GIF and TIFF and PDF file formats

Page 57: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

LZW Coding

• A codebook or a dictionary has to be constructed.– Single pixel values and blocks of pixel values

• For an 8-bit image, the first 256 entries are assigned to the gray levels 0,1,2,..,255.

• As the encoder examines image pixels, gray level sequences (i.e., pixel combinations) that are not in the dictionary are assigned to a new entry.

Page 58: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Example

Consider the following 4 x 4 8 bit image

39 39 126 126

39 39 126 126

39 39 126 126

39 39 126 126

Dictionary Location Entry

0 01 1. .255 255256 -

511 -

Initial Dictionary

Page 59: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Example

39 39 126 126

39 39 126 126

39 39 126 12639 39 126 126

- Is 39 in the dictionary……..Yes - What about 39-39………….No - Then add 39-39 in entry 256

Dictionary Location Entry

0 01 1. .255 255256 -

511 -

39-39

Page 60: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Example

39 39 126 12639 39 126 12639 39 126 12639 39 126 126

concatenated sequence (CS)

If CS not found: (1) Output D(CR) (2) Add CS to D (3) CR=P

If CS is found: (1) No Output (2) CR=CS

(CR) (P)

Page 61: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Decoding LZW

• The dictionary which was used for encoding need not be sent with the image.

• A separate dictionary is built by the decoder, on the “fly”, as it reads the received code words.

Page 62: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Run-length coding (RLC)(i.e., removes interpixel redunancy)

• Used to reduce the size of a repeating string of characters (i.e., runs)

a a a b b b b b b c c (a,3) (b, 6) (c, 2)

• Encodes a run of symbols into two bytes , a count and a symbol.

• Can compress any type of data but cannot achieve high compression ratios compared to other compression methods.

Page 63: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Run-length coding(i.e., removes interpixel redunancy)

• Code each contiguous group of 0’s and 1’s, encountered in a left to right scan of a row, by its length.

1 1 1 1 1 0 0 0 0 0 0 1 (1,5) (0, 6) (1, 1)

Page 64: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Bit-plane coding(i.e., removes interpixel redundancy)

• An effective technique to reduce inter pixel redundancy is to process each bit plane individually

• The image is decomposed into a series of binary images.

• Each binary image is compressed using one of well known binary compression techniques.– e.g., Huffman, Run-length, etc.

Page 65: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Combining Huffman Coding with Run-length Coding

• Once a message has been encoded using Huffman coding, additional compression can be achieved by encoding the lengths of the runs using variable-length coding!

e.g., (0,1)(1,1)(0,1)(1,0)(0,2)(1,4)(0,2)

Page 66: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Lossy Compression

• Transform the image into a domain where compression can be performed more efficiently.

• Note that the transformation itself does not compress the image!

~ (N/n)2 subimages

Page 67: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Lossy Compression (cont’d)

• Example: Fourier Transform

The magnitude of the FT decreases, as u, v increase!

K-1 K-1

K << N

Page 68: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Transform Selection

• T(u,v) can be computed using various transformations, for example:– DFT

– DCT (Discrete Cosine Transform)

– KLT (Karhunen-Loeve Transformation)

Page 69: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

DCT

if u=0

if u>0

if v=0

if v>0

forward

inverse

Page 70: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

DCT (cont’d)

• Basis set of functions for a 4x4 image (i.e.,cosines of different frequencies).

Page 71: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

DCT (cont’d)

DFT WHT DCT

RMS error: 2.32 1.78 1.13

8 x 8 subimages

64 coefficientsper subimage

50% of the coefficientstruncated

Page 72: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

DCT (cont’d)

• DCT minimizes "blocking artifacts" (i.e., boundaries between subimages do not become very visible).

DFT

i.e., n-point periodicitygives rise todiscontinuities!

DCTi.e., 2n-point periodicityprevents discontinuities!

Page 73: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

DCT (cont’d)

• Subimage size selection

2 x 2 subimagesoriginal 4 x 4 subimages 8 x 8 subimages

Page 74: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

JPEG Compression

• JPEG uses DCT for handling interpixel redundancy.

• Modes of operation:(1) Sequential DCT-based encoding

(2) Progressive DCT-based encoding

(3) Lossless encoding

(4) Hierarchical encoding

Page 75: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

JPEG Compression (Sequential DCT-based encoding)

encoder

Page 76: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

JPEG Steps

1. Divide the image into 8x8 subimages;

For each subimage do:

2. Shift the gray-levels in the range [-128, 127]

3. Apply DCT (64 coefficients will be obtained: 1 DC coefficient F(0,0), 63 AC coefficients F(u,v)).

4. Quantize the coefficients (i.e., reduce the amplitude of coefficients that do not contribute a lot).

Quantization Table

Page 77: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

JPEG Steps (cont’d)

5. Order the coefficients using zig-zag ordering

- Place non-zero coefficients first

- Create long runs of zeros (i.e., good for run-length encoding)

6. Encode coefficients.

DC coefficients are encoded using predictive encoding

All coefficients are converted to a binary sequence:

6.1 Form intermediate symbol sequence

6.2 Apply Huffman (or arithmetic) coding (i.e., entropy coding)

Page 78: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Example: Implementing the JPEGBaseline Coding System *

Page 79: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Example: Level Shifting

Page 80: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Example: Computing the DCT

Page 81: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Example: The Quantization Matrix

Page 82: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Example: Quantization

Page 83: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Zig-Zag Scanning of the Coefficients

Page 84: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

JPEG

Page 85: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

JPEG

Page 86: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.
Page 87: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.
Page 88: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Example: Coding the Coefficients

• The DC coefficient is coded (difference between the DC coefficient of the previous block and current block)

• The AC coefficients are mapped to runlength pairs– (0,-26) (0,-31) ……………………..(5,-1),(0,-1),EOB

• These are then Huffman coded (codes are specified in the JPEG scheme)

Page 89: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Example: Decoding the Coefficients

Page 90: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Example: Denormalization

Page 91: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Example: IDCT

Page 92: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Example: Shifting Back the Coefficients

Page 93: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Example

Page 94: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

JPEG Examples

90 (58k bytes)50 (21k bytes)10 (8k bytes)

best quality,

lowest compression

worst quality,

highest compression

Page 95: Image Compression (Chapter 8). Introduction The goal of image compression is to reduce the amount of data required to represent a digital image. Important.

Results