Compress an image without wrecking it
What JPEG quality settings actually do, why resizing beats compressing, and the order of operations that gets a photo under a size limit while still looking right.
Updated 2026-08-03
Most advice about image compression starts and ends with a quality slider, which is the least effective of the three levers available. Dimensions matter more than quality, format matters more than either, and the order you apply them in changes the result substantially. Here is what each control actually does, and the sequence that gets a photo under a limit with the least visible damage.
Resize first. It is not close.
File size scales with pixel count, which scales with the square of the dimensions. Halving an image's width and height quarters its pixel count — a reduction quality settings cannot approach without visible artifacts. A 4000px photo displayed 800px wide is carrying twenty-five times more data than the screen can use.
| Change | Effect on file size | Effect on how it looks |
|---|---|---|
| Halve the dimensions | About 75% smaller | None, if it was larger than its display size |
| Quality 90 → 75 | About 40% smaller | Essentially invisible on photos |
| Quality 75 → 50 | About 30% smaller | Visible on flat areas and edges |
| Quality 50 → 30 | About 25% smaller | Obvious blocking and mosquito noise |
| JPEG → WEBP at the same quality | About 25–35% smaller | None |
| Strip metadata | 0–200KB | None — and it removes your GPS coordinates |
What the quality number actually controls
It is not a percentage of anything. JPEG quality selects a quantization table — how aggressively the encoder discards high-frequency detail after a discrete cosine transform. That is why the damage appears first at sharp edges and in smooth gradients, and why photographs survive low settings far better than screenshots of text do.
- 85–95 — visually lossless for photographs. Above 95 you are storing noise.
- 70–80 — the working range. Almost everything on the web sits here.
- 50–65 — visible on inspection, acceptable for thumbnails.
- Below 50 — obvious artifacts. Use only when the size limit is absolute.
- Never re-encode a JPEG repeatedly. Each pass compounds the previous pass's errors, and it cannot be undone.
Pick the format for the content, not the habit
| Content | Use | Why |
|---|---|---|
| A photograph | WEBP, or JPEG for compatibility | Lossy compression is built for continuous tone |
| A screenshot with text | PNG, or WEBP lossless | JPEG destroys sharp edges — text gets a halo |
| A logo or icon | SVG | Vector scales to any size at no cost |
| A diagram with flat color | PNG | Few colors compress extremely well losslessly |
| Anything needing transparency | PNG or WEBP | JPEG has no alpha channel at all |
| An animation | WEBP or MP4 | GIF is 256 colors and enormous — it is a 1987 format |
The order that works
- Strip metadata. Free, and it removes the GPS coordinates you did not know were there.
- Resize to twice the display width. Twice, not once — that covers high-density screens and nothing more.
- Convert to WEBP unless something in your pipeline cannot read it.
- Then set quality, starting at 80 and dropping only if you must.
- Compare at 100% zoom, not fitted to the window. Artifacts hide at small sizes and appear in print.
When compression is the wrong answer
A file that is already small will get larger, not smaller — re-encoding adds overhead and there is nothing left to discard. A screenshot of text should be resized or re-taken rather than compressed. And a scanned document that needs to stay searchable should not be flattened into images at all, which is exactly what aggressive PDF compression does to it.
Questions
Why did compressing make my file bigger?
Because it was already efficiently encoded. Re-encoding an optimized JPEG or a small PNG adds container overhead while finding nothing further to discard. Resize instead, or leave it alone.
What quality setting should I use?
80 as a default, then look at the result at full zoom. Photographs tolerate 70 without complaint; anything containing text or sharp lines wants 85 or a lossless format instead.
Is WEBP safe to use now?
Yes. Every current browser has supported it for years, including Safari since 2020. The remaining friction is desktop software and older email clients, so JPEG stays the safer choice for an attachment someone will open in an unknown application.
Does compressing an image remove its metadata?
Usually but not reliably — it depends on the encoder. If removing GPS coordinates is the goal, do it deliberately with a tool that says it did, rather than hoping compression happened to.