How to Compress Images Without Losing Quality
Updated July 16, 2026
The single most effective step: change the format
The fastest way to shrink an image without hurting quality is to convert it to a modern format. A photograph exported as a 4 MB PNG can drop to 500 KB as WebP at quality 80 with no visible difference. Format choice usually beats every other compression tweak combined.
WebP is the current default for the web. It supports both lossy and lossless modes, handles transparency, and is understood by every major browser released in the last five years. AVIF compresses even smaller than WebP but encodes more slowly and has slightly weaker browser support.
Pick the right quality slider setting
Every lossy encoder exposes a quality parameter from 0 to 100. This number is not a percentage of the original - it is an internal knob that trades detail for file size. In practice, three ranges cover almost every use case:
- Quality 90-95: archival-grade photos, hero images, product shots.
- Quality 75-85: the default sweet spot for web images. Visually indistinguishable from the original for almost every viewer.
- Quality 60-70: thumbnails and background images where small artifacts are acceptable in exchange for very small files.
- Below 60: only for previews and placeholders - artifacts become obvious.
Use chroma subsampling for photographs
Human eyes are much more sensitive to brightness than to color. Chroma subsampling (usually notated 4:2:0) throws away 75% of the color detail while keeping full brightness detail. On a photograph this saves roughly 20% file size with no perceptible loss.
Turn subsampling OFF (4:4:4) for screenshots of text, logos, and any image with sharp color edges - subsampling smears those edges. Turn it ON for people, landscapes, food, and product photos.
When to go lossless
Lossless compression rewrites the file more efficiently without discarding any data. It is the right choice for logos, icons, line art, screenshots of text, and any image that will be edited further.
For lossless work, lossless WebP typically beats PNG by 25-35% in file size and preserves transparency. When PNG is required for compatibility, use a palette (PNG-8) whenever the image has fewer than 256 distinct colors - a UI icon set often shrinks 4x this way.
Resize before compressing
A 6000-pixel-wide photo displayed at 800 pixels is wasting 98% of its data. Resizing before compression is the single biggest saving no encoder can make for you. Serve images at their displayed dimensions, or use a responsive srcset so browsers download the appropriate size.
Frequently asked questions
What is the best format for compressing photos on the web?
WebP at quality 80 is the best default for photographs on the web in 2026. It typically produces files 25-35% smaller than JPEG at equivalent visual quality, with 95%+ browser support.
Does resizing an image also compress it?
Yes. Fewer pixels means less data to encode. Halving both width and height reduces file size roughly 4x before any compression is applied. Resize first, then compress.
Is lossless compression really lossless?
Yes. Lossless formats (PNG, lossless WebP) reconstruct the original file bit-for-bit. They shrink files by finding patterns and encoding them more efficiently, not by discarding image data.
How much can I compress without visible loss?
For photographs, quality 80 in WebP or quality 85 in JPEG is visually indistinguishable from the original for almost every viewer. Expect 60-80% file size reduction from a source PNG or full-quality JPEG.