How to Compress Images Without Losing Visible Quality
A photo from a modern phone is 12 megapixels and 3 to 5 MB. The page it ends up on usually shows it about 1,200 pixels wide. Almost all of those bytes pay for detail nobody will ever see, which is why image compression is one of the few optimisations that costs nothing visible when it is done properly.
Doing it properly comes down to three decisions, in this order: how many pixels, which format, and what quality.
1. Resize first — it is the biggest win
File size scales roughly with the number of pixels, and pixels scale with the square of the width. Take a 4000 × 3000 photo down to 1600 × 1200 and you have removed 84% of the pixels before touching the quality slider. No quality setting comes close to that saving without visible damage.
A useful ceiling is the largest size the image will actually be displayed at, doubled for high-density screens if it matters. For most web pages, blog posts and marketplace listings, 1600 to 2000 pixels on the long edge is plenty.
Downscaling itself can go wrong. Shrinking a large image in a single step samples too few of the source pixels, and fine patterns such as fabric, brick or text shimmer and alias. Good resizers reduce in steps, halving the size each time until the last step is less than 2×. The Image Compressor does this automatically when you set a maximum width or height.
2. Choose the format for the content
JPEG is still the universal format for photographs. It handles smooth, noisy, real-world images well and opens everywhere.
WebP does the same job, typically 25–34% smaller than JPEG at the same visual quality in Google’s own comparison, and every current browser displays it. If the image is going on a website, WebP is usually the right answer. One catch: not every browser can create WebP from a web page — Safari is the notable exception — so a browser-based tool should tell you when that happens.
PNG is lossless. It is the right choice for screenshots, diagrams, logos and anything with sharp edges or text, and it supports transparency. It is the wrong choice for photos: a photograph saved as PNG can easily be five times the size of a good JPEG with no visible benefit.
AVIF compresses further still, but it is slow to encode and patchily supported as an output in browsers today. Treat it as a bonus, not a default.
3. Pick a quality — and know what the slider does
JPEG and WebP split the image into small blocks and throw away the fine detail in each block that the eye is least likely to miss. The quality setting controls how aggressively. The relationship is far from linear: going from 100 to 85 often halves the file with no visible change, while going from 60 to 30 saves comparatively little and starts to look bad.
For photos, 70–80 is the usual sweet spot. Artefacts appear first in three places, so check them rather than the image as a whole:
- Faces and skin, which pick up blotchy blocks.
- Text and sharp edges, which grow a halo of “mosquito noise”.
- Smooth gradients such as skies, which break into visible bands.
A before-and-after slider makes this quick: drag it across those areas at 100% zoom. If you cannot see the difference there, nobody else will at normal size.
Hitting a file-size limit without guessing
Upload forms often set a hard limit: under 200 KB, under 1 MB. Guessing a quality, exporting and checking is tedious, especially for a batch.
The fix is a search. Encode at high quality; if it is too big, try the middle of the range; keep halving the range towards the largest quality that fits. Seven or eight encodes pin it down to within a percent or so. If even the lowest quality is still too large, no quality setting will do it — the image needs fewer pixels, which takes you back to step 1.
Why compressing can make a file bigger
It is surprisingly common to “compress” an image and get a larger file back. An already-optimised JPEG re-encoded at quality 90 keeps the damage from the first compression and adds the overhead of the second. A PNG exported by a good optimiser, re-saved by a browser’s basic PNG encoder, often grows too.
Two rules follow. Always compress from the original rather than from an already-compressed copy, because every lossy pass loses a little more. And a compressor should never hand you back a bigger file than you gave it: when nothing else changed, the original is the better output.
A bonus: metadata disappears
Re-encoding an image redraws only its pixels, so the EXIF metadata a phone attaches — camera model, timestamps and often the GPS coordinates of where the photo was taken — is dropped along the way. If you want the metadata gone without any recompression, the EXIF remover strips it losslessly and shows you exactly what was there.
Uploading is optional
Many popular compressors send your images to their servers to process them, which is why their free tiers limit the number and size of files. Modern browsers can decode, resize and re-encode images themselves, so there is no technical need to upload anything. That matters most for exactly the photos people most want to shrink: ID scans for forms, property photos, family pictures. The wider argument is in private online tools for everyday tasks.
The checklist
Resize to the largest size the image will be shown at. Use WebP for the web, JPEG for compatibility and PNG for screenshots and graphics. Start at quality 75 and check faces, text and skies. Use a target size when a form sets a limit. And never compress the same image twice.
Related reading: how long should a password be?