Lossy vs Lossless Compression: A Practical 2026 Decision Guide
When quality 80 beats 95, SSIM and Butteraugli thresholds that matter, and format-specific sweet spots for AVIF, WebP, JPEG XL, and PNG.
Lossy vs Lossless Compression: A Practical 2026 Decision Guide
The "should I go lossy or lossless" question usually gets answered by gut feel. That works until a client zooms into a 4K product shot and spots banding on the backdrop, or until your LCP drops because someone set every PNG to quality 100 "just to be safe." Here's how to pick, with numbers.
The metric you should actually use
PSNR is still quoted everywhere, but it hasn't matched human perception for years. Two numbers worth knowing in 2026:
- SSIM (Structural Similarity). Ranges 0 to 1. Anything above 0.98 is usually indistinguishable at typical viewing distances.
- Butteraugli (from Google). Lower is better. A score below 1.5 is generally "no visible difference," 1.5 to 3.0 is "you can find the difference if you pixel-peep," and above 3.0 is visible at a glance.
SSIMULACRA2, the successor from the libjxl team, is the one to trust for modern codecs. Scores above 90 mean the compression is visually lossless; 70 to 90 is "fine for web," below 50 starts to look rough.
When quality 80 beats quality 95
For a typical sRGB JPEG saved out of Photoshop:
| Setting | File size (1920x1080 photo) | SSIMULACRA2 |
|---|---|---|
| q95 | 480 KB | 94 |
| q85 | 260 KB | 88 |
| q80 | 210 KB | 85 |
| q70 | 150 KB | 78 |
The jump from q80 to q95 more than doubles the file size for about 9 points of SSIMULACRA2. Your users will not see that. For hero images on a marketing page, q80 to q82 is almost always the right answer. For thumbnails, q70 is fine.
The exception is images with large flat color regions (illustrations, UI screenshots). JPEG's 8x8 DCT blocks eat posterized gradients for breakfast at q80. That's when you switch codecs, not when you crank the slider.
Format-specific sweet spots
- JPEG: q80 to q85 for photos. Use 4:2:0 chroma subsampling for photos, 4:4:4 if there is red text on colored backgrounds.
- WebP: quality 75 matches JPEG q85 at roughly 25 percent smaller size. Use lossless WebP only for screenshots and simple graphics under 500 KB.
- AVIF: quality 50 to 60 on libavif's scale (which is not the same as JPEG's) is the sweet spot. Encoding is slow; use speed 6 for batch jobs.
- JPEG XL: distance 1.0 is visually lossless, distance 1.5 to 2.0 is the web sweet spot. With Chrome 145 shipping native support, it's finally worth shipping.
- PNG: always lossless, but run through oxipng level 4 or zopflipng. Savings of 15 to 30 percent with zero quality change are routine.
When lossless is the right call
Four cases where you should not compromise:
- Source files and masters. If you will re-edit or re-export, keep a lossless original. Generation loss on JPEG is real; after five re-saves at q85 you lose about 4 SSIMULACRA2 points.
- Medical, legal, or scientific imagery. Self-explanatory.
- Screenshots and UI mockups. PNG or lossless WebP. JPEG's DCT will chew on 1px borders and text edges.
- Icons and logos under 50 KB. The savings from lossy are measured in bytes; the risk of edge artifacts is not worth it.
For everything else, lossy in a modern codec beats lossless in an old one by a wide margin. A q60 AVIF of a photo often undercuts a zopflipng PNG of the same photo by 10x while remaining visually indistinguishable.
A quick decision flow
Is it a photo or photo-like render?
yes -> lossy AVIF q55, fall back to JPEG q82
no -> does it have text, flat colors, or sharp edges?
yes -> lossless WebP or optimized PNG
no -> lossy WebP q78
This covers maybe 90 percent of real-world web images. The remaining 10 percent (HDR photography, scientific visualization, high-contrast illustrations with gradients) deserve actual A/B comparisons with SSIMULACRA2.
The batch problem
One-off decisions are easy. Shipping 4,000 product photos through a pipeline with consistent quality is the real work. If you're doing this by hand in an image editor, you are losing hours per week. Running them through batch conversion with a fixed quality target and a checked output histogram catches the outliers (dark night shots, heavy-noise sensor data) that need individual attention, and gets the other 95 percent done in one pass.
The takeaway: stop defaulting to q95. Pick a codec that matches the content, target SSIMULACRA2 of 85 or higher, and spend your time auditing the 5 percent of images that don't fit the rule.