Workbench
Guide

Why JPEG Images Lose Quality and How Compression Works

JPEG does not store your photograph — it stores something that looks like it to a human eye, and permanently discards the rest. Knowing which step throws things away explains every complaint about JPEG quality.

The bargain JPEG makes

JPEG does not try to store your photograph. It tries to store something that looks like your photograph to a human eye, using far fewer bytes, and it is willing to permanently discard anything it judges you will not miss.

That is a genuinely good trade for photographs, and it is why the format has survived for decades. It is also the source of every complaint about JPEG quality, because the judgement is approximate and you have limited control over it. Understanding roughly what gets discarded explains both why photos survive it so well and why screenshots do not.

What happens when you save a JPEG

Four stages. Two of them can discard information, and only one of them always does — which is the useful thing to know.

1. Separating brightness from colour

The image is converted from red/green/blue into a form that keeps brightness in one channel and colour in two others. This is a change of colour representation rather than a reduction, and it sets up the next step. It matters because human vision is far sharper for brightness than for colour.

2. Reducing colour resolution

Because of that asymmetry, encoders commonly store the colour channels at reduced resolution while keeping brightness at full. This step is called chroma subsampling, and where it is used it is genuinely lossy — colour resolution is thrown away. It is common but optional: JPEG also allows 4:4:4 sampling, which keeps colour at full resolution, and encoders often switch to it at their highest quality settings.

On a photograph the effect is nearly invisible, because colour in nature changes gradually. On a hard boundary between two saturated colours it is very visible indeed, which is where red text on white starts to look smeared.

3. Describing the image in patterns

Each channel is divided into small square blocks, and each block is converted from a grid of values into a description of the patterns it contains: how much broad, smooth variation, how much medium detail, how much of the very finest alternation. A block of clear blue sky is almost entirely "broad, smooth" with essentially nothing at the fine end. A block containing an edge has energy across the range. Still no loss — this is a reversible change of description.

4. Quantisation — the central lossy step

Now each of those pattern strengths is divided by a number from a table and rounded. Values for fine detail are divided by large numbers, so many round to zero and vanish. Values for broad structure are divided by small numbers and survive nearly intact.

Quantisation is the central lossy step in ordinary DCT-based JPEG. Unlike chroma subsampling it is not optional, and it is where the quality setting does its work — the setting simply selects which table of divisors gets used. The stage immediately before it is reversible, and everything after it — the entropy coding that packs the numbers efficiently — is completely lossless. When people say JPEG "throws away detail", this is usually the moment they mean.

The quality number is not a percentage

A quality of 80 does not mean "80% of the image is retained". It selects how aggressively the quantisation table divides, and the mapping is a convention, not a standard.

Two practical consequences follow.

Numbers are not comparable across tools. Quality 80 in one program and quality 80 in another can produce noticeably different files, because they use different tables. A number that works in your usual editor is not portable advice.

The relationship to file size is not linear. Dropping from 100 to 90 typically saves a great deal of size for very little visible change, because the highest settings spend enormous effort on detail nobody perceives. Dropping from 60 to 50 saves much less and costs much more. The steep part of the curve is at the top, which is why quality settings in the 75–85 region are a common working range: past that you pay a lot for very little.

The Workbench Image Converter exposes quality as a value from 0.3 to 1.0, passed to your browser's own encoder. It applies to JPG and WebP output and is ignored for PNG, which has no such trade-off. Because encoders differ, the honest advice is the same as everywhere else: convert once at around 0.8, look at the result at full size, and adjust from there rather than trusting the number.

Recognising the four artefacts

Knowing what you are looking at tells you what to change.

Blocking

Faint square tiles across areas that should be smooth — skies, walls, skin, shadows. It appears because each block was compressed independently, so neighbouring blocks settle on slightly different average values and the seam becomes visible. Blocking is the signature of a quality setting pushed too low.

Ringing

A faint halo or shimmer hugging sharp edges, most obvious around text on a plain background. When the fine-detail components that would have made an edge crisp are rounded away, what remains reconstructs the edge as a slight overshoot on either side.

Colour bleed

Colour appearing to leak past the boundary it belongs to, again worst on saturated edges. This comes from chroma subsampling at stage two. Where an encoder uses it, raising the quality setting reduces the symptom without removing the cause — only encoding at 4:4:4, or choosing a different format, does that.

Banding

Smooth gradients breaking into visible stripes rather than shading continuously. Sunsets and studio backdrops show it first. The gradual variation that should distinguish adjacent tones is exactly the low-amplitude information quantisation removes.

Advertisement

Generation loss: why re-saving hurts

Open a JPEG, make a small change, save it again, and you have not simply added one small change. The file was decoded, the pixels were altered, and the whole image was quantised again — a second full pass of rounding applied to data that had already been rounded once.

Do it repeatedly and losses accumulate, particularly if the image is edited between saves, or if the quality setting changes, or if the image is cropped. Cropping is the sneaky one: it can shift the image relative to the block grid, so the second pass divides the picture along different lines than the first and none of the earlier structure lines up.

This is why a picture that has been forwarded, saved, re-shared, and screenshotted several times acquires that unmistakable degraded look. Each step was reasonable; the sequence was not.

The defence is a workflow rather than a setting:

Not quite right"I converted the JPEG to PNG to stop it losing more quality."

Half true, and it is worth being precise. Converting to PNG does prevent further lossy compression, so if the file faces more editing rounds it is a sensible intermediate. What it cannot do is repair anything: every artefact already in the JPEG is preserved perfectly, in a much larger file. PNG is a way to stop the bleeding, never a cure.

What JPEG is bad at, and why

Every weakness follows from the same design. JPEG assumes photographic content: smooth variation, no hard edges, no perfectly flat regions, no transparency.

Progressive vs baseline — a difference that is not about quality

A baseline JPEG stores the image top to bottom, so on a slow connection it appears as a curtain descending. A progressive JPEG stores it in successive passes of increasing detail, so a blurry version of the whole image appears first and sharpens.

This is purely about the order data is arranged in. Both are ordinary JPEG files, and neither is inherently higher quality than the other. The distinction shows up in web performance discussions, not in image quality ones — it is worth knowing mainly so the terms do not sound like a quality choice when you meet them.

Habits that keep quality

Takeaway

  • Quantisation is JPEG's central lossy step, where fine detail is rounded away. Chroma subsampling, where an encoder uses it, discards colour resolution too; the entropy coding afterwards is lossless.
  • The quality number selects a rounding table. It is not a percentage and is not comparable between tools.
  • Blocking, ringing, colour bleed, and banding each point to a different cause, and knowing which you are seeing tells you what to change.
  • Loss accumulates with every re-save. Keep originals, edit from them, and export once.
  • Nothing recovers discarded detail. Converting to PNG afterwards preserves the damage in a larger file.