technology
did you know a JPEG saves space by letting details go?
your photo becomes a recipe of patterns, with some ingredients rounded away.
64 pixels
one 8 × 8 block becomes a pattern recipe
quantisation rounds the recipe; later coding stores it compactly.
- transform
- round coefficients
- encode efficiently
the idea
common JPEG compression reduces file size partly by discarding information. it turns small image blocks into a mixture of patterns, then stores those pattern strengths with limited precision.
how it works
the transform alone does not make the information disappear. quantisation does: divide coefficients by chosen step sizes and round them. many small coefficients become zero, which subsequent lossless coding can represent efficiently.
go deeper
what if pixels could become a recipe?
common JPEG compression reduces file size partly by discarding information. it turns small image blocks into a mixture of patterns, then stores those pattern strengths with limited precision.
an eight-by-eight block contains 64 samples. a transform expresses the block using 64 coefficients: one describes its average level, while others describe progressively finer changes across it.
round away the expensive details
the transform alone does not make the information disappear. quantisation does: divide coefficients by chosen step sizes and round them. many small coefficients become zero, which subsequent lossless coding can represent efficiently.
stronger quantisation usually makes smaller files but introduces more visible changes. edges can acquire ripples, and the underlying block structure can become noticeable at low quality.
what does rounding actually lose?
with a step size of ten, a coefficient of 23 is stored as 2 after division and rounding. reconstructing gives 20, not 23. the discarded difference cannot be uniquely recovered from the file.
stored = round(23 / 10) = 2; reconstructed = 2 × 10 = 20
why can repeated saving hurt?
- decoding and re-encoding with lossy settings can introduce additional changes. simply copying the same file does not.
- JPEG includes several modes. this explanation describes the familiar lossy, block-transform process, not every standard carrying the JPEG name.
sources & further reading
concepts: compression · discrete cosine transform · quantisation
2 minute read