Lossy vs Lossless Image Compression Explained
Every image format compresses data, but not in the same way. Knowing the difference saves you from blurry pictures and giant files.
Lossless: smaller, but nothing is lost
Lossless compression finds patterns and stores them more efficiently, much like a ZIP file. When you open the image, every pixel is exactly as it was. PNG, GIF, BMP (optionally) and lossless WebP work this way.
The saving is modest for photographs, because photos are full of noise that has few patterns. For flat graphics, though, it can be excellent.
Lossy: much smaller, with a quality trade
Lossy compression permanently removes information the eye is least likely to miss, such as tiny color differences and very fine detail. JPG, lossy WebP, AVIF and HEIC use it. The file can shrink by 90 percent or more, and at moderate settings the change is almost impossible to see.
Push it too far and artifacts appear: blocky squares, smeared edges, banding in skies and a muddy look in dark areas.
Generation loss
Each time a lossy file is opened, edited and saved again, it is compressed again and loses a little more. After many rounds the damage becomes visible. This is called generation loss.
Keep an untouched original, do your edits and save to a lossy format only once at the end. If you need many rounds of editing, work in a lossless format such as PNG or TIFF and export a JPG at the very end.
Picking a quality setting
For JPG and WebP, a quality of 80 to 85 is a safe default for pictures you care about, and 70 to 75 is plenty for most web use. Below 60 the loss becomes easy to notice on close inspection. Always judge at 100 percent zoom, not on a thumbnail.
What does not make it better
Converting a lossy file to a lossless one, such as JPG to PNG, never brings back lost detail. It only stops further loss. Likewise, converting a heavily compressed image to a higher quality setting just makes the file bigger without improving it.