People use the two words interchangeably, but they do different things to a file. Compression changes how the pixels are stored. Resizing changes how many pixels there are.
The two levers
| Compression | Resizing | |
|---|---|---|
| Changes | Encoding settings | Pixel dimensions |
| Removes | Redundant or imperceptible data | Pixels, permanently |
| File size | Depends on the image and encoding settings | Fewer pixels to encode |
| Visual cost | Artefacts, banding, softness | Loss of detail beyond the new size |
| Reversible | No | No |
| Best for | Files that are already the right size | Files that are larger than the layout needs |
Original PNG
1086 × 1448 px · 2.32 MB
Palette at quality 70
1086 × 1448 px · 708 KB
Resized to 50%
543 × 724 px · 892 KB
When compression wins
The image is already the right dimensions for its slot, but the file is heavy. A 1600-pixel photo that should weigh 200 KB and weighs 1.2 MB is a compression problem: the export settings were generous, or the file carries metadata it does not need.
When resizing wins
The image is bigger than anything that will ever display it. A 6000-pixel camera file in an 800-pixel column is wasting seven-eighths of its pixels — no compression setting will recover that, because the data is genuinely there.
Resizing also fixes the subtler problem: browsers downscale large images with varying quality, and the result is often softer than a properly resized file.
Do both, in this order
- Crop to the composition you want.
- Resize to the largest size the layout needs.
- Compress at the highest quality that still meets your size budget.
Doing it in the other order wastes effort: compressing first means you are compressing detail you are about to delete.
What not to do
- Do not compress an image twice hoping to halve it again. Lossy generations stack; the second pass mostly adds artefacts.
- Do not resize a resized file. Keep the original and regenerate.
- Do not upscale to "improve quality". Interpolation invents pixels; it cannot recover detail.
One rule of thumb
If the pixel dimensions are wrong, resize. If the dimensions are right, compress. If both are wrong, resize first.