JPEG
A lossy format optimized for photographs. Uses DCT for high compression but degrades on re-compression.
JPEG (Joint Photographic Experts Group) is a still image compression standard from 1992. It uses lossy compression exploiting human visual perception to store photographs at high compression ratios, remaining one of the most widely used web image formats.
The compression pipeline divides images into 8x8 pixel blocks, applies the Discrete Cosine Transform (DCT) to convert spatial data into frequency components, then quantizes high-frequency components less perceptible to the human eye. Huffman coding performs final entropy compression.
- Quality parameter: A 0-100 value controls the compression-quality trade-off. 75-85 is the practical sweet spot for web use
- Progressive JPEG: Renders incrementally from low to high resolution for early previews on slow connections
- Color space: Converts to YCbCr and subsamples chroma at 4:2:0 for additional compression
Limitations include no alpha channel support, visible block artifacts on sharp-edged content like text, and cumulative generation loss on re-compression. Editing workflows should maintain intermediates in PNG or TIFF, converting to JPEG only for final delivery.