Guides

Lossy vs Lossless: What You're Actually Trading Away

By the Laborilo team. Last updated August 20, 2026.

Hitting "compress" on a photo you actually care about feels like a one-way risk, especially if you've ever watched a JPEG get re-saved a few times and come out visibly worse each round. That worry is well-founded for one of these paths and not the other. "Compress this image" can mean two very different things: shrinking the file by discarding detail permanently, or shrinking it by repacking the exact same data more efficiently. Only one of those is reversible.

Lossless: repacking, not removing

PNG compression works the same way a zip file does. It's DEFLATE, a general-purpose algorithm that finds repeated patterns in the data and replaces them with shorter references, then decompresses back to the exact original pixels with zero loss. That makes PNG genuinely lossless: decompress it and you get back the identical bitmap, bit for bit. The tradeoff is that DEFLATE only exploits repetition, so it does very well on flat-colored graphics, screenshots, and line art, and comparatively poorly on photos, where nearly every pixel differs slightly from its neighbors.

Lossy: deciding what your eye won't miss

JPEG takes a fundamentally different approach. It splits an image into 8×8 pixel blocks, converts each block into frequency data using a discrete cosine transform, and then quantizes that data. Rounding the fine, high-frequency detail more aggressively than the coarse, low-frequency detail, because human vision is measurably less sensitive to sharp small-scale variation than to broad shifts in brightness and color. That rounding step is the "loss". It's not reversible, and it's also why heavily compressed JPEGs show blocky artifacts along edges: the algorithm is throwing away exactly the high-frequency information that sharp edges are made of.

That's also why re-saving the same JPEG over and over makes it visibly worse each time, even at an unchanged quality setting: every save re-runs the same rounding step on data that's already been rounded once, so the errors from the first compression compound with new ones from the second. It isn't the format degrading with age, it's each save independently throwing away a little more detail on top of what the last save already discarded.

The other lossy trick: subsampling color before compression even starts

Most lossy encoders also apply chroma subsampling, storing color information at lower resolution than brightness information (a common scheme, 4:2:0, keeps full brightness detail but only a quarter of the color detail). This works for the same underlying reason DCT quantization works: the eye's brightness perception is sharper than its color perception. It's also why lossy compression is much rougher on line art or text than on photos. Those depend on sharp color boundaries, exactly what subsampling degrades. Which is why screenshots and diagrams should generally stay PNG or lossless WebP rather than JPEG.

What to actually do with this

None of this means every lossy save is destructive in a way you'd notice. Photographs with continuous tone and natural detail compress well under JPEG or lossy WebP with barely visible quality loss at 10-20% of the original file size. Screenshots, UI mockups, logos, and anything with flat color fields or crisp text should stay lossless (PNG, or lossless WebP, which typically beats PNG by 20-30% at equal quality). Running them through a lossy encoder tends to produce visible ringing around edges for a smaller size saving than you'd get compressing a photo. WebP and AVIF support both modes in one format and generally out-compress JPEG and PNG respectively at equivalent visual quality, which is why most modern image pipelines default to them when browser support allows.

If the goal is shrinking a photo you care about, a single lossy save at a moderate quality setting is safe, the loss on one well-configured pass is usually invisible; just keep the original untouched and compress a copy rather than repeatedly re-saving the same file. If the goal is a screenshot, logo, or diagram that needs to stay crisp, skip lossy entirely and use PNG or lossless WebP, since there's little size to gain and real quality to lose. If the goal is the smallest possible file at quality you can live with, AVIF or lossy WebP at a slightly lower setting usually beats a "high quality" JPEG in actual visible sharpness at a smaller size.

Compress or resize an image and see the size difference directly with the image compressor.