Skip to content
FilesSeptember 10, 2026· 8 min read

Lossy vs Lossless Compression: What Actually Happens to Your Image

Every image format makes a trade-off between file size and quality. Here's what lossy and lossless compression actually do to your data, in plain terms.

By Piyush

Every image file is a compromise between size and quality, and that compromise comes down to one core decision: does the compression throw information away, or not? That single question is the difference between lossy and lossless compression, and it explains almost everything about why JPG, PNG and WebP behave so differently.

Lossless: smaller, but honestly

Lossless compression finds patterns and redundancy in the data and encodes them more efficiently, without discarding any information. Decompress a lossless file and you get back the exact original, bit for bit. PNG is the common lossless image format: it works well on images with large flat areas of a single color, sharp edges and text — logos, screenshots, diagrams — because those have a lot of repeating patterns to compress efficiently. On a busy photograph with subtle color gradients everywhere, PNG has much less redundancy to exploit, so the file stays large.

Lossy: smaller, because it cheats a little

Lossy compression, used by JPG and (optionally) WebP, gets much smaller files by discarding information the human eye is less likely to notice missing. JPG specifically takes advantage of the fact that human vision is far more sensitive to changes in brightness than to changes in color, so it keeps brightness detail largely intact while compressing color information more aggressively, and also groups the image into small blocks and simplifies the fine detail within each one. At normal viewing sizes and reasonable quality settings (75–85%), this is genuinely invisible to most people. Push the quality too low and the shortcuts become visible as blocky artifacts, especially around sharp edges and text.

Every time you re-save a JPG, this discarding happens again on top of whatever was already lost, which is why repeatedly editing and re-saving the same JPG file gradually degrades it — a real phenomenon sometimes called generation loss.

Choosing the right one

  • Photographs, real-world images: use lossy (JPG or WebP). The quality loss is invisible at reasonable settings and the file size savings are large.
  • Logos, screenshots, diagrams, text-heavy images: use lossless (PNG). Lossy compression on flat-color graphics tends to introduce visible smudging around sharp edges that wasn't there before.
  • Anything that needs transparency: use PNG (or WebP, which also supports transparency). JPG cannot represent transparent pixels at all.
  • Anything you'll edit and re-save repeatedly: keep a lossless master copy and only export a lossy version for final use, to avoid compounding quality loss over time.

Where WebP fits in

WebP is unusual because it supports both modes in one format: lossy WebP typically beats JPG by 25–35% at equivalent quality, and lossless WebP typically beats PNG by 20–30%. If your target platform supports it (nearly all current browsers do), WebP is usually the better default in either case — the main reason to still reach for JPG or PNG specifically is compatibility with an older system or a tool that doesn't yet accept WebP.

Related tools

Frequently asked questions

Lossless compression shrinks a file without discarding any data — decompressing it recovers the exact original. Lossy compression achieves much smaller files by permanently discarding information the format decides is least noticeable, which means the original can't be perfectly recovered.
Yes. Each time a JPG is re-saved, the lossy compression discards a little more information on top of what was already lost in previous saves. Keep an original or a lossless master copy if you'll be editing the same image repeatedly.
PNG is always lossless, so it never loses quality — but that doesn't automatically make it the better choice. For photographs, a well-compressed JPG at 80-85% quality is visually indistinguishable from the PNG while being a fraction of the file size.
In most cases, yes. WebP supports both lossy and lossless modes, produces smaller files than JPG or PNG at equivalent quality, and is supported by the vast majority of browsers in use today. Stick with JPG or PNG only if you need compatibility with a specific older system.

Keep reading