Quantization (Compression)
Also known as: quantization jpeg, quant table, quantization in compression, quantization compression
Quantization is the lossy step in image and video compression that rounds away fine detail the eye barely notices. Coarser quantization throws out more data and produces smaller files, which is why a lower quality setting yields a smaller photo.
- Quantization is the lossy step that rounds away detail; it is what makes JPEG and video lossy.
- Coarser quantization (lower quality / higher QP) zeroes more coefficients and shrinks the file.
- Re-encoding an already-compressed image re-quantizes it, compounding artifacts (generation loss).
How quantization works
Codecs like JPEG, HEVC, and AV1 transform image blocks into frequency coefficients (JPEG uses the DCT, the Discrete Cosine Transform). Most visual energy sits in the low-frequency coefficients; high-frequency detail contributes little to how we perceive an image.
Quantization divides each coefficient by a value from a quantization table and rounds the result, deliberately discarding precision. Many high-frequency coefficients round to zero, which then compress extremely well. This rounding is irreversible, which is exactly why these formats are lossy.
Why lower quality means smaller files
A JPEG quality slider (or a video QP, quantization parameter) scales the quantization table. A lower quality setting uses coarser steps, zeroes out more coefficients, and shrinks the file, at the cost of visible artifacts like blocking and color banding.
Because quantization is lossy, re-encoding an already-compressed JPEG repeatedly compounds the damage (generation loss). For storage cleanup, a single re-compression at a sensible quality can reclaim space, but keep originals when fidelity matters and avoid repeatedly saving over the same file.