← Back to Lesson 17

Quiz 17: Image Compression — Lossless and Lossy

Score: 0 / 4

. What kind of image content does run-length encoding (RLE) compress well?

RLE stores (value, run length) pairs for consecutive identical pixels, so it shines on flat regions but does nothing useful when pixel values rarely repeat, as in noisy photographs.

. What does Shannon entropy represent in the context of lossless image compression?

Entropy H = -sum(p_i * log2(p_i)) is the theoretical minimum average bits/pixel achievable by any prefix code based on the symbol probabilities; Huffman coding gets close to, but does not always exactly reach, this bound.

. In JPEG compression, what is the main effect of quantizing (dividing and rounding) the DCT coefficients of an 8x8 block?

Quantization divides coefficients by values from a quantization table and rounds, zeroing out many low-energy (mostly high-frequency) coefficients so they cost almost nothing to store.

. Why is JPEG generally a poor choice for compressing graphics like screenshots or text, compared to PNG?

A sharp edge's energy is spread across every DCT frequency (like the cross pattern in a Fourier spectrum), so the same quantization that photos tolerate produces visible ringing and blocking artifacts around graphics' edges and text.