To reduce an image's file size without visible quality loss, do four things in order: resize it to the largest width your site displays, save it in a modern format such as AVIF or WebP, use a high (not maximum) quality setting, and strip metadata you don't need. Then compare the result with the original before you publish. On 54 real business photos, those steps took the total from 183.0 MB to 16.2 MB while every file kept an SSIM of 0.99 or higher against the resized original.
Key takeaways
- Most of the saving comes from resizing. Camera and phone photos have far more pixels than a web page shows.
- AVIF and WebP compress photos better than JPEG at similar quality, according to MDN's image format guide. Keep a fallback in mind for AVIF.
- "High" quality, not "maximum", is usually where file size drops sharply and visible quality does not.
- Stripping metadata saves bytes without touching pixels, but keep attribution fields if you rely on them.
- Check results with your eyes at 100% zoom, and with a metric such as SSIM when you process many files.
Why images are bigger than they need to be
A typical photo straight from a camera is sized for print or cropping, not for a web page. In our sample run, the median original was 24 megapixels and about 3.0 MB (MB here means 1,048,576 bytes, as our tool reports it). A website column is rarely more than 2,000 px wide, and a phone screen is far narrower. Every extra pixel still has to be downloaded.
The second reason is encoding. Many photos are saved as high-quality JPEGs, which keep detail nobody will see at web size. Re-encoding at a sensible quality, in a format designed for the web, removes that excess.
Step 1: Resize to the width you actually display
Find the widest size an image appears on your site. A full-width hero might be 1,600 to 2,048 px; an image inside a blog column might be 800 to 1,200 px. Export at that width (or up to twice it if you want sharpness on high-density screens) and no larger.
In our sample run every photo was resized to 2,048 px wide, enough for a full-width image on most layouts. Across the 54 photos that cut the pixel count from 1,262 megapixels to 194 megapixels: about 15% of the original pixels remained. That one step accounts for a large share of the final saving, because file size grows with pixel count.
If your site uses responsive images, also create smaller versions (for example 300, 768 and 1,024 px wide) so phones download a small file. The plumber photo from our run weighed 7 KB at 300 px, 17 KB at 768 px and 23 KB at 1,024 px as AVIF.
Step 2: Choose the right format
For photographs, the realistic choices today are JPEG, WebP and AVIF.
- JPEG is lossy only and has no transparency. It works everywhere.
- WebP supports lossy and lossless compression, transparency and animation. Caniuse reports about 97% global browser support.
- AVIF also supports lossy and lossless compression, transparency and animation. Caniuse reports about 96% global support, with Safari support arriving in version 16 on iOS and fully in 16.4 on macOS. MDN advises including a fallback format when you use AVIF.
In our run, at the same High preset and size, the totals were 27.1 MB as JPEG, 26.7 MB as WebP and 16.2 MB as AVIF. AVIF was the smallest of the three for all 54 photos. WebP was not always smaller than JPEG: it came out larger for 20 of the 54 photos at these settings. If you only change format, test a few of your own images first.
Keep PNG for graphics that need exact pixels or transparency where AVIF and WebP are not an option. It is a poor choice for photographs.
Step 3: Use a high quality setting, not the maximum
Quality settings are not linear. Going from "maximum" to "high" usually removes a lot of bytes and very little visible detail; going from "high" to "low" starts to show blocking, banding in skies and smeared texture.
Our tool's High preset, used for the sample run, encodes JPEG and WebP at quality 82 and AVIF at quality 55 with full chroma (4:4:4). Those numbers are not universal; each encoder has its own scale. The practical method is the same with any tool:
- Export one representative photo at two or three quality levels.
- View each at 100% zoom next to the original, looking at faces, skies, fine text and fabric.
- Pick the lowest setting where you cannot see a difference, then use it for the batch.
Step 4: Strip metadata you don't need
Camera files carry EXIF data: camera model, exposure, date and sometimes GPS location. Removing it does not change the pixels. Google's documentation on image license metadata notes that removing metadata can reduce file size, and also recommends keeping creator, credit line and copyright fields where attribution matters. So strip by default, and keep or re-add the fields you rely on.
All photos in our sample run were exported with metadata stripped.
How to check that quality held up
Looking is still the first test: zoom to 100% and compare the same area of both files. For more than a handful of images, a metric helps. SSIM (structural similarity), introduced by Wang, Bovik, Sheikh and Simoncelli in 2004, scores how similar two images are in structure on a scale where 1.0 means identical.
In our sample run, each AVIF was compared with the original resized to the same dimensions, measured at 1,024 px. The lowest score among the 54 photos was 0.9908 and the median was 0.9964. This measures what the encoding changed, not the resize, so it answers the question "does the smaller file still look like the photo at that size?"
Two cautions. SSIM is a model of perception, not a guarantee, so keep spot-checking by eye. And a photo with fine noise or grain will compress less: one photo in our run, a sunset yoga silhouette that was only slightly wider than the target, shrank by just 24%, while the median photo shrank by about 94%.
Doing it for many photos at once
The steps are the same for one photo or a whole folder; the difference is tooling. Desktop editors can batch-export, and command-line tools can script it. An online tool can do the resize, format conversion, quality preset and metadata stripping in one pass.
If you want to try this on your own photos, our bulk image compression tool runs the same pipeline used for the sample run. The Free plan covers your first 15 photos, once, with AVIF or JPG output; photos larger than 3 MB are resized to fit. WebP output, larger files and AI alt text start on Starter. For single files, see compress JPG or convert JPG to AVIF.
Keep reading
Sources
Questions
Short answers to what people ask about this.