How to compress images without ruining them

Most compression advice says "use 80%". That number is a starting point, not a rule. This is what the quality setting actually does to a photograph, and how to find the right value for the image in front of you.

Image compression has an unusual property for something so widely used: the correct setting depends entirely on the image. Advice that quotes a single number is describing a starting point, not an answer. Here is what is actually happening when you move that slider.

What the quality setting controls

For JPEG and WebP, quality is a budget for how much detail the encoder may discard. The encoder splits the image into blocks, converts each one into a frequency description, and then rounds the less important frequencies more aggressively. A low quality means coarser rounding: fewer distinct values, smaller file, more visible structure in the result.

The important consequence is that the loss is not evenly distributed. Smooth areas — sky, skin, a painted wall — survive well because they contain little high-frequency detail to discard. Sharp edges, fine texture and small text do not: they are exactly what the encoder is being asked to throw away.

Where the artefacts appear first

If you want to judge a setting, look at these places rather than the whole image:

  • High-contrast edges. A dark object against a bright background develops a faint halo or ringing. This is often the first visible sign.
  • Fine repeating texture. Fabric, grass, hair and brickwork turn from texture into mush.
  • Gradients. A smooth sky starts to show banding, because neighbouring values that were slightly different become identical.
  • Small text. Anything under about 14 pixels in the original becomes unreadable well before the rest of the image looks wrong.

Check those four areas at 100% zoom, not at 400%. Nobody will look at the image at 400%, and judging compression that way leads to files that are needlessly large.

A practical way to choose

Compress one image three times rather than guessing: at 85%, 75% and 65%. Compare them side by side at the size they will actually be displayed. In most cases one of the three is obviously fine and the next one down is obviously not, which tells you more than any general rule.

Two things worth knowing before you start. The relationship between quality and file size is not linear: dropping from 90% to 80% usually saves far more than dropping from 60% to 50%. And below roughly 50%, the damage grows faster than the saving, which is the point where reducing the image's dimensions becomes the better tool.

Why dimensions beat quality

File size scales roughly with the number of pixels. Halving the width and the height leaves a quarter of the pixels, and a correspondingly smaller file. Quality, by contrast, gives diminishing returns: there is only so much detail to remove before the image is ruined.

So if an image is 3000 pixels wide and will be displayed at 800, resizing it is both more effective and less damaging than compressing it hard at full size. The compressor on this site offers a maximum width and height for exactly that reason.

Compress once, from the original

JPEG and lossy WebP lose a little quality every time they are re-encoded, and the file does not keep halving. Re-compressing an already-compressed photograph often leaves it about the same size — sometimes larger — while adding a second generation of damage. Always start from the file that came out of the camera or the editor.

If the only copy you have is already compressed, compare the result with what you started with before replacing anything. The tool shows both sizes for exactly this reason, and says plainly when the output grew.

Related pages