Images are the heaviest part of almost every website. A single unoptimized photo straight from a camera can weigh 5 megabytes or more — and a page with several of them can take ten seconds to load on a phone. Visitors leave, search rankings slip, and mobile data burns for no good reason.
The fix is image compression: shrinking file sizes dramatically while keeping photos looking sharp. Done well, you can cut 70 to 80 percent of the weight with no visible difference. This guide explains how compression works, how to choose formats and settings, and the mistakes that turn good photos into mushy ones.
Why image size matters more than you think
Every kilobyte of a web page has to travel from a server to the visitor's device, and images typically account for more than half of a page's total weight. On slow or metered mobile connections — which describe most of the world's browsing — heavy pages simply do not get viewed. Studies have repeatedly tied load time to bounce rates: shave seconds off, and measurably more people stay.
Search engines noticed too. Page speed is a confirmed ranking factor, and image weight is usually the biggest lever a site owner can pull. Compressing images is one of the highest-return optimizations available: it is free, it takes minutes, and it improves experience for every visitor on every page.
The same logic applies beyond websites. Compressed images upload faster to social platforms and marketplaces, attach to emails without bouncing, and take less storage on your devices. It is basic digital hygiene.
How compression works: the quality tradeoff
Photo formats like JPG and WebP use lossy compression: they discard visual detail the human eye barely notices — subtle color variations, fine noise — and keep the structure that matters. A quality setting controls how aggressive this discarding is. At 90 percent quality, the savings are modest and the image looks identical to the original. At 80 percent, files shrink dramatically with differences visible only under close inspection. Below 60 percent, artifacts appear: blocky patches, halos around edges, smeared gradients.
The key insight is that the relationship is not linear. Dropping from 100 to 85 percent quality often halves the file size with no perceptible change; dropping from 60 to 40 percent saves little more while visibly degrading the image. The sweet spot for web photos sits around 75 to 85 percent — the zone where the eye cannot tell but the file is a fraction of its original weight.
WebP, the modern format developed by Google, compresses 25 to 35 percent better than JPG at equivalent visual quality, and it supports transparency like PNG. It is now supported by all major browsers, making it the best default choice for web photos. Keep JPG as a fallback only when you need maximum compatibility with older systems.
- WebP — best choice for web photos: smallest files, great quality, transparency support
- JPG — universal compatibility, good for photos when WebP is not an option
- PNG — only for graphics needing transparency or pixel-perfect sharpness, never for photos
- AVIF — even better compression than WebP, but slower to encode and less universally supported
A practical compression workflow
Start with the largest dimension your image will ever be displayed at. A photo shown at 800 pixels wide does not need to be 4000 pixels wide — resize it first, because dimensions multiply file size. This single step often saves more than compression itself.
Next, choose WebP output and set quality to around 80 percent. Preview the result at full size and zoom into detailed areas: faces, text, sharp edges against smooth backgrounds. If it looks clean, try 75 percent and compare again. Stop when you can just barely perceive a difference, then step back up one notch — that is your setting.
For images with text overlays, logos, or sharp graphics, be more conservative: use 85 to 90 percent, or keep them as PNG if absolute crispness matters. Text is where compression artifacts are most noticeable, because the eye is excellent at spotting smeared letterforms. When in doubt, compare side by side at 100 percent zoom.
- Resize to display dimensions first — never upload a 4000px image shown at 800px
- Convert to WebP at 75-85% quality for photos
- Use 85-90% or PNG for images containing text or logos
- Always compare before and after at full zoom before publishing
Common mistakes that ruin image quality
The most damaging mistake is compressing an already-compressed image repeatedly. Each save throws away more detail, and artifacts compound. Always compress from the highest-quality original you have — the camera file or the master export — never from a copy that was already squeezed for social media.
Second is ignoring dimensions. People compress a 5-megabyte photo down to 1 megabyte and celebrate, when resizing it to the actual display size would have produced a 150-kilobyte file at better quality. Compression and resizing are partners; use both.
Third is using PNG for photographs. PNG is lossless, which sounds better, but for photos it produces files five to ten times larger than a good WebP with no visible advantage. Reserve PNG for screenshots, diagrams, and graphics with flat colors and sharp edges — the content it was designed for.
Finally, do not trust thumbnails. Compression damage hides at small sizes and ambushes you on large screens. Judge quality at full resolution, on the kind of display your audience uses.
Compression for different uses
Websites and blogs: WebP at 75 to 85 percent, resized to the layout's maximum display width. Hero images can go slightly higher; thumbnails can go lower. This is the everyday case and where compression pays off most.
Online stores: product photos deserve 80 to 85 percent — customers zoom in, and artifacts cost sales. Keep a high-quality master archived, and generate compressed versions for the storefront.
Social media: platforms recompress everything you upload, so give them the best starting point: high quality (85 to 90 percent) at the platform's recommended dimensions. Uploading an already-crushed image means it gets crushed twice.
Email and messaging: here convenience wins. Stronger compression (60 to 70 percent) keeps attachments small and sending fast, and nobody inspects email photos at full resolution.
Frequently asked questions
Will compression make my photos look bad?
Not if you stay in the sensible range. At 75-85% quality in WebP, differences from the original are essentially invisible in normal viewing. Quality loss becomes noticeable only at aggressive settings, which is why previewing before publishing matters.
What is the difference between JPG and WebP?
Both are lossy photo formats, but WebP is a newer, more efficient design: it produces files 25-35% smaller than JPG at the same visual quality, and it supports transparency. All modern browsers display WebP, so it is the better default for the web.
Should I keep the original files?
Yes, always. Compression discards data permanently, so keep an untouched master copy archived. Generate compressed versions from the master whenever you need them, and never compress a compressed copy.
Does compression affect print quality?
For print, keep quality at 90% or above and keep full dimensions — print needs far more detail than screens. The aggressive settings recommended for web use will look soft or artifacted on paper.
Can I compress images on my phone?
Yes. Browser-based compression tools work on phones and tablets, processing everything on the device. Just be aware that very large photos take longer on less powerful hardware.
Conclusion
Image compression is one of those rare optimizations that is free, fast, and almost entirely upside. Resize to display dimensions, convert to WebP, dial quality into the 75 to 85 percent sweet spot, and preview before publishing. Your pages will load faster, your visitors will stay longer, and your photos will look just as good as they always did — at a fraction of the weight.