Image Compression for Faster Websites
Images are usually the heaviest part of a web page. A single uncompressed photo from a phone can weigh 4 or 5 megabytes — more than the rest of the page put together. Visitors on slow connections wait, search engines rank slow pages lower, and mobile users burn through data. Image compression fixes all three problems at once, and it takes about a minute per image once you know the workflow.
What image compression actually does
Compression removes information from an image file that the eye barely notices. A photo of a sky, for example, contains thousands of nearly identical blue pixels; a good compressor stores the pattern once instead of thousands of times. There are two kinds:
- Lossy compression permanently discards some detail. JPG and WebP are lossy formats. Used sensibly, the loss is invisible; pushed too far, the image looks blotchy, especially around text and sharp edges.
- Lossless compression shrinks the file without losing any pixels at all, by storing the data more efficiently. PNG is lossless, which is why screenshots and logos stay sharp — but the files are bigger.
For photographs, lossy compression is almost always the right choice. For screenshots, logos and diagrams, keep PNG or use a high quality setting so the text stays crisp.
Choosing a quality setting
Quality is a number, usually from 0 to 100, that trades file size against visible detail. These are practical starting points:
- 90 to 95: near-original quality for hero images and photography portfolios, where detail matters.
- 80 to 85: the sweet spot for ordinary web photos. Most visitors cannot tell the difference from the original.
- 60 to 75: small thumbnails and images that sit behind text, where nobody looks closely.
- Below 60: usually too aggressive — blocky artefacts appear in skies and on faces.
When in doubt, compress at 80, open the result full-screen and look at it. If you cannot see a difference from the original, the setting is right. If you can, raise it to 85 or 90 and try again.
Resize before you compress
Compression and resizing solve different problems, and the order matters. A photo displayed at 800 pixels wide does not need to be 4000 pixels wide in the file: those extra pixels are pure waste. Resize first, then compress:
- Find out how wide the image will actually display on your site — most content areas are 800 to 1200 pixels wide.
- Resize the image to that width, or a little more for sharp screens — 1600 pixels is plenty for a full-width banner.
- Compress the resized image at quality 80.
Resizing alone often cuts a file by two thirds. Combined with compression, a 4 MB phone photo routinely becomes 200 to 400 KB — a tenth of its original size.
Which format should you use?
- JPG: the safe default for photographs. Every browser and device supports it.
- WebP: the modern choice — typically 25 to 35 percent smaller than the same image as a JPG, with no visible difference. Supported by all modern browsers.
- PNG: the right choice for screenshots, logos and anything with transparency or sharp text.
- AVIF: even smaller than WebP, but not yet supported everywhere, so keep it for sites where you control the audience.
A simple rule: photos become WebP (or JPG if you need maximum compatibility), screenshots and logos stay PNG.
A one-minute workflow for every image
- Open the Image Compressor and choose the image from your device. Nothing is uploaded — the work happens in your browser.
- Set the quality to 80 and a maximum width that matches where the image will appear.
- Compress and compare the original and compressed sizes side by side.
- If the image will be displayed large, resize it first with the Image Resizer, then compress the resized copy.
- If the image is a JPG and you want the smallest file, convert it to WebP with the Image Converter.
- Download the finished file and upload it to your site with a descriptive file name, such as handmade-oak-table.jpg instead of IMG_4821.jpg.
How to check the improvement
Measure before and after, or the work is guesswork. In your browser, open the page, press F12, go to the Network tab and reload: it shows every file and its size. A page whose images total under 1 MB is in good shape; a page over 3 MB needs attention. Free tools such as Google PageSpeed Insights give the same figures with plain-language recommendations.
One warning: compressing an image twice does not help. Each lossy pass throws away a little more detail, so always compress from the original file, never from an already compressed copy.
Common mistakes
- Uploading phone photos untouched. A 12-megapixel phone photo is far larger than any screen needs.
- Using PNG for photographs. A PNG photo can be five times larger than the same image as a JPG.
- Compressing the same file twice. Quality degrades with every pass, so keep the original safe.
- Forgetting thumbnails. A gallery of twenty thumbnails at full size is twenty full-size downloads. Resize thumbnails to their display size.
Image compression is the easiest speed win on most websites: no code changes, no new hosting, just smaller files. Do it for every image before upload and the habit pays for itself on every visit.