Guide · Image compression

Shrink images
without guessing

Every image format in common use spends bits the same three ways. Learn the levers once and you stop guessing at quality sliders — and stop shipping megabytes you did not need.

Image formats · Quality · Resolution · Offline
3 levers that matter57.8% avg saved at 850 uploads
The idea

Compression removes what the eye under-weights

An encoder is not a file zipper. It rewrites the picture in a form where detail the visual system barely notices costs almost nothing.

Explainer

Two families, one goal

Lossless and lossy compression both exploit redundancy. Lossless encoders find patterns a decoder can reverse exactly: repeated pixel runs, predictable neighbouring values, repeated byte sequences. Lossy encoders go further and discard information outright — usually coefficients too small to see, and colour detail the eye resolves poorly.

The practical difference is not quality, it is guarantees. Lossless output is bit-identical to the input, forever. Lossy output is an approximation, and once discarded the detail is gone: re-encoding a lossy file at higher quality does not restore it, it just stops making things worse.

Why photos compress and screenshots do not

A photograph is smooth: neighbouring pixels are similar, so a frequency transform concentrates almost all the energy into a few coefficients. A screenshot of black text on white is the opposite — every glyph edge is a sharp discontinuity, and sharp edges need coefficients. That is why the same codec that halves a holiday photo will balloon a UI capture into a blurry mess, and why PNG exists at all.

This is also the single fact that makes format choice useful: match the codec to the content, not to a preference.

The model

Three levers.
Nothing else.

Format, quality and pixel dimensions. Every other control in a compressor is a convenience wrapper around one of these.

Format

The codec decides what is even possible. JPEG cannot store transparency; PNG cannot offer a quality dial; AVIF buys the smallest files with the slowest encode.

Quality

A quantisation multiplier, not a percentage. The useful range is narrower than the slider suggests — 85 and 95 usually look identical and differ by a third of the bytes.

Resolution

Pixels are the real cost. Halving each dimension quarters the pixel count — a bigger saving than any quality slider, and often invisible on delivery.

Order matters. Spending quality before fixing resolution is the most common way to ruin an image and still ship it too large.

Measured

Where the bytes actually go

Savings depend far more on content and format than on the tool you use. These are the ranges we measured over 1002 Wikimedia images with real vips at quality 85 balanced.

Input → outputTypical savingWhat drives it
JPEG → JPEG, quality 8550–60%Quantisation of high-frequency coefficients
JPEG → WebP25–35% beyond JPEGBetter entropy coding and prediction
PNG → WebP70–85%Palette and predictability of flat graphics
JPEG → AVIF30–50% beyond JPEGLarger block sizes, better intra prediction
Resize 4000px → 2000px≈75%Quarter of the pixels, nothing else changed

The full method, per-file numbers and the caveats live on the benchmarks page. Read it before quoting any percentage as a promise — your folder is not our folder.

How it fails

What damage looks like, in order

Push quality down and artefacts arrive in a predictable sequence. Recognising the stage tells you which lever you spent wrongly.

01 First
Chroma bleed

Colour is subsampled before anything else. Thin red type on white starts to fringe and saturated edges lose their edge colour.

02 Then
Banding

Smooth skies and gradients collapse into visible steps, because quantisation rounds similar coefficients to the same value.

03 Later
Ringing

Sharp edges — text, window frames — grow a halo of faint ripples as truncated high frequencies stop cancelling.

04 Last
Blocking

The 8×8 grid becomes visible as a checkerboard. At this point the file is small because the picture is gone.

If you see blocking on a photograph, you are past the useful range. Resize instead of compressing harder.

Decision

Pick the format by content

A four-line decision covers almost every case. The rest of this site explains each branch in depth.

The capability matrix — compression type, alpha, animation and support — is in image formats compared.

ContentUseWhy
PhotographsJPEG, or WebP/AVIF for deliveryJPEG decodes everywhere; WebP and AVIF are smaller for the same look
UI, screenshots, logos with flat colourPNG, or lossless WebPLossy codecs destroy hard edges; PNG keeps them exact
Anything needing alpha on the webWebP or AVIFBoth carry alpha; WebP has the wider decode support
AnimationVideo, not GIFGIF stores every frame whole; an MP4 of the same loop is an order of magnitude smaller
Photographs that must be tinyAVIFSmallest at equal quality, at the cost of encode time
Workflow

Hit a target size in the right order

If the requirement is a number — 100KB, 200KB, a CMS cap — spend the cheap levers first.

Change format first Moving a photo from JPEG to WebP at the same visual quality is free size. Moving a screenshot off PNG is often the whole fix.
Resize second If the delivery width is 1080px, a 4000px original is waste no compressor can recover. Resize before you touch quality.
Spend quality last Quality 85 is the default for a reason. Only go below 80 once format and dimensions are settled.
Verify at 100% Judging compression on a downscaled preview hides every artefact you care about.
Batch the same recipe Per-file tuning produces an inconsistent gallery and takes a day. One recipe, one review pass.

If the constraint is "without losing quality", start with the near-lossless path instead — it is a different tradeoff, not a stricter setting.

Myths

Four beliefs that cost megabytes

Quality 100 means no quality loss

No. JPEG at quality 100 still quantises — it just uses a finer table. The file grows enormously for detail no display will show. If you need exact pixels, the format has to be lossless.

Compressing an already-compressed file ruins it

Re-encoding at a lower quality does compound damage, but re-encoding at the same setting mostly wastes a generation for little gain. Compress once, from the original, and keep the original.

PNG is always higher quality than JPEG

PNG is lossless, which is not the same as better. For a photograph, a well-encoded JPEG is visually indistinguishable and a fraction of the size. PNG wins on sharp edges and transparency, not on photographs.

Higher DPI makes an image sharper

DPI is a print metadata field. It changes the physical size an image prints at, not the pixels it contains. Upscaling to "300 DPI" invents nothing.

If it looks fine on my screen, it is fine

Downscaled previews hide blocking and ringing. Judge at 100% and on the size it will actually ship at — those are different tests.

Next

Go deeper on one lever

How it works

The pipeline every lossy codec shares: transform, quantise, entropy-code. The mechanism →

Lossy vs lossless

What each guarantees, and what "perceptually lossless" is allowed to mean. Compare →

Start compressing

Apply the recipe to a whole folder, offline, with per-file results. Compress an image →

Offline · No upload

Apply the guide to a real folder

Quality, format and resize in one pass, with before/after numbers on every file.

Windows 10/11 · 64-bit · Free