Lossless vs lossy compression: understand to choose right
Lossless doesn't mean better quality. It means identical quality, and sometimes that's precisely what you don't need. Here's how to tell the two methods apart and choose the right format based on what you're compressing.
7 min read
En résumé
Lossless compression preserves every pixel of the original image, the file reduces little, quality stays intact. Lossy compression removes barely perceptible data to drastically reduce weight. Practical rule: photos and complex visuals → lossy; logos, text and screenshots → lossless.
What the two methods do to your pixels
Lossy compression
Method that permanently removes part of the image data: color variations deemed imperceptible to the human eye. The file is lighter, but the original content is unrecoverable.
Aussi appelé : lossy, destructive compression
Ex : A landscape photo at JPEG quality 85: visually identical to the original, 3 to 5 times lighter.
Lossless compression
Method that reorganizes image data without removing anything: like ZIP applied to pixels. The file is lighter, but quality is rigorously identical to the original after decompression.
Aussi appelé : lossless, non-destructive compression
Ex : A logo in compressed PNG: 20 to 30% less weight, every pixel remains intact.
The distinction doesn’t concern perceived quality on screen. It concerns what remains in the file after compression is applied.
With lossless compression, every pixel is preserved. The codec spots repetitive patterns in the image and encodes them more efficiently, but nothing is removed. Decompressed, the file is identical to the original to the pixel.
With lossy compression, the codec discards data the eye distinguishes poorly: micro color shifts in uniform zones, imperceptible transitions between complex gradients. The result is lighter. Much lighter. And that data is gone forever.
Lossy compression: when it works and when it breaks
On a mountain photo, lossy compression is nearly invisible at quality 85. A photo contains millions of micro variations. The codec removes a few tens of thousands. The eye can’t tell, the file loses 70 to 80% of its weight.
On a logo with black text on white background, it’s the opposite. The codec sees a sharp edge and tries to simplify it. It adds compression artifacts (gray or slightly colored pixels) where the original was perfectly binary. In practice: this JPEG logo will have fuzzy edges even at 90 or 95% quality.
The JPEG logo trap
Exporting a logo or text-bearing image as JPEG produces visible artifacts around sharp edges, even at high quality. Lossy compression isn’t designed for this type of content, no matter the setting.
Lossy compression level is set via a “quality” parameter (0 to 100 in JPEG). Quality 85 is often a good threshold for photos: significant reduction, imperceptible artifacts. Going below 70 becomes risky depending on content.
Lossless compression: the right choice, but not always
Lossless compression is often presented as “the compression that preserves quality”. That’s accurate, but incomplete, and this framing makes people believe it’s the default best choice.
A PNG of a 4 MB photo will give a file between 2.5 and 3.5 MB. The same file as JPEG quality 85 will be 400 to 800 KB. For a photo published on a website, choosing PNG offers no visible benefit — and bloats the page by a factor of 4 to 7.
Lossless compression is useful in specific cases. Logos, icons, screenshots, diagrams, images with uniform zones and sharp edges. It’s also essential for files that will be re-encoded multiple times: archives, source illustrations, printing exports.
According to context: if the image is only viewed once on screen, well-calibrated lossy compression is almost always the right choice for photos. If the image contains text or sharp edges that must stay precise, lossless compression becomes necessary.
For concrete parameters — quality thresholds, formats recommended per case, practical tools — our lossless image compression guide covers operational details.
JPEG, PNG, WebP, AVIF: which method uses which format?
Formats and compression methods
| Format | Method | Typical reduction | Browser support | Ideal for |
|---|---|---|---|---|
| JPEG | Lossy only | 60–80 % vs RAW | 100 % | Photos, complex visuals |
| PNG | Lossless only | 10–30 % vs RAW | 100 % | Logos, text, transparency |
| WebP | Both (configurable) | 25–35 % vs JPEG (lossy) | 97 % | General-purpose web |
| AVIF | Both (configurable) | 35–50 % vs JPEG (lossy) | ~94 % | Modern web, high fidelity |
| GIF | Lossless (256 color palette) | Variable | 100 % | Simple animations only |
Data verified May 2026, browser support per caniuse.com
❌ Idée reçue
JPEG loses quality every time you open it.
✅ Réalité
False. Opening a JPEG doesn't modify the file — no degradation on read. Quality only decreases with each re-save (Save As, export). A JPEG opened then closed without modification remains strictly identical.
Source : JPEG Specification — CCITT T.81
WebP and AVIF support both methods. In practice: a lossy WebP of a photo will be 25 to 35% lighter than equivalent JPEG at identical quality; a lossless WebP of a logo will be slightly lighter than PNG, with transparency support as a bonus.
For more on concrete differences between JPEG, PNG, WebP and AVIF by use case, see our comparison JPEG, PNG, WebP: which format compresses best for your use?.
The visual criterion to choose without going wrong
No need to know codecs. One question is enough: look at your image.
Complex gradient zones, natural colors, lots of fine details? Lossy compression. Person photos, landscapes, product shots: it’s precisely the terrain for which lossy algorithms were designed.
Large uniform zones, sharp edges, text, solid colors, transparent background? Lossless compression. Logos, interfaces, diagrams, screenshots: anything with precise outlines that lossy codec will blur.
If your image mixes both (text on photo background, for example), choose PNG or WebP lossless. The compromise beats artifacts on text.
To apply this principle directly in your browser — without sending to a server, zero data transmitted — Impmage applies compression suited to your chosen format with before/after preview.
Frequently asked questions
What's the difference between lossless and lossy compression? ▾
When should I use lossless compression? ▾
Is JPEG lossy compression? ▾
Does PNG preserve the original image quality? ▾
Is WebP compression lossy or lossless? ▾
Can you recover quality from a lossy-compressed image? ▾
Which compression to choose for e-commerce product photos? ▾
What's the weight difference between lossless and lossy on an image? ▾
Compress your images without sending them anywhere
100% local, free, no account. No image leaves your browser.
Try Impmage
GlitchGhost
Independent developer
Developer specializing in web performance and image optimization. Creator of Impmage.