Image Compressor
Back to Blog

How JPEG Compression Works

2026-09-15

The problem JPEG was designed to solve

An uncompressed photo is enormous. A 12 megapixel image needs roughly 36 MB before you do anything to it, which was unusable on 1990s connections and is still wasteful today.

JPEG was built on one insight: human vision is far more sensitive to brightness than to colour. So it keeps brightness detail and throws most colour detail away. That single trade-off does most of the size reduction before any quality slider is involved.

What actually happens, in order

The quality slider controls one step

Contrary to how it is marketed, the quality setting does not change how the algorithm works. It changes the size of the quantisation step. Higher quality means finer frequency detail is preserved; lower quality rounds it away.

This is why quality reductions are not linear. Dropping from 100 to 90 costs almost nothing visually. Dropping from 50 to 40 is where visible damage usually appears.

Why artifacts cluster around edges

Sharp edges contain high-frequency energy. Quantisation removes high frequencies first, so the parts of the image with the most high-frequency content lose the most. That is exactly where the familiar blocky and ringing artefacts show up.

It also explains why text and line art compress badly. They are almost entirely high-frequency content, which is the first thing JPEG discards.

Choosing a setting

The rule that matters most

Never edit and re-save a JPEG repeatedly. Every save applies quantisation again to already-quantised data, and the damage accumulates. Keep a lossless master and export a JPEG only at the end.

FAQ

Is quality 100 lossless?

No. JPEG is lossy at every setting, including 100. For truly lossless storage use PNG or a lossless format.

Does re-saving a JPEG twice halve the quality?

Not exactly, but the loss does compound. The second save quantises data that already lost detail, so the visible decline is often larger than the first save.

Why does my PNG sometimes compress smaller than JPEG?

For flat-colour graphics and screenshots, PNG can win, because JPEG is spending bits trying to represent sharp edges that PNG stores exactly.

Compress images in the browser and see the size before you commit

More reads: How to Compress JPG to Under 100KB Online (Free, No Sign-Up)How to Compress PNG Without Losing Quality (Free, Online)The Complete Guide to Compressing WebP Images

Free guide: compress images to an exact size (200KB / 100KB / 50KB) →