DCT Image Compression

Worked through the JPEG pipeline by hand, then swept the quantization matrix to find the ideal quality factor.

Full paper (PDF)

JPEG is lossy compression. How much you can throw before it matters? Scaling the quantization matrix sweeps a quality factor from 0 to 2. Scoring each reconstruction against the original with SSIM gives a clean inverse curve. Naively maximizing SSIM per kilobyte says quality factor 0 is optimal, but that image is visibly wrecked. Instead reading the SSIM curve through diminishing returns puts the practical optimum between 0.4 and 0.6.

SSIM against quality factor, following an inverse curve that flattens past 0.6
SSIM against quality factor. Past ~0.6 the extra kilobytes stop buying visible quality.
Lenna reconstructed at quality factor 0, visibly pixelated in 8-pixel blocks
Reconstruction at quality factor 0 — the SSIM-per-KB "optimum". Recognizable, but not a keeper.

The full derivation and the matrices at every stage are in the paper:

Other projects