Every image compressor uses one of two approaches, and knowing the difference helps you pick the right format and quality setting.

This guide explains both in plain language, with the formats that use each and simple rules for choosing.

Key Takeaway: Keep a lossless original, then export lossy copies for the web. Never keep re-saving a lossy file.

What Is Lossless Compression?

Lossless compression removes redundancy in the data, like repeated colors, without throwing anything away. When the file is opened, every pixel is exactly as before. PNG is the common lossless web format. The trade-off is that files are larger, especially for photos.

What Is Lossy Compression?

Lossy compression permanently removes detail that people are unlikely to notice, such as subtle color variations. That is how JPG gets photos so small. At a sensible quality the change is invisible; push the quality too low and you see blocky artifacts and blur. Because the loss is permanent, repeated saves keep making it worse.

Which Formats Use Which?

FormatCompressionBest for
JPGLossyPhotos
PNGLosslessLogos, screenshots, transparency
WebPLossy or losslessWeb images of either kind
AVIFLossy or losslessModern web photos

See WebP vs PNG vs JPG and WebP vs AVIF for format-by-format comparisons.

How to Choose

Pro Tip: Even PNGs can be optimized with smart, near-lossless methods. Try the compressor and compare the result. Our guide on compressing without losing quality shows how.

Frequently Asked Questions

What is the difference between lossy and lossless compression?

Lossless keeps every pixel and can be reversed exactly. Lossy permanently discards some detail to reach a smaller file.

Is JPG lossy or lossless?

JPG is lossy. Each save at a lower quality discards more detail, so avoid re-saving the same JPG many times.

Is PNG lossless?

Yes. PNG keeps every pixel, which is why it suits logos and screenshots, but its files are bigger than JPG for photos.

Can I convert lossy back to lossless?

You can store it in a lossless format, but the detail already lost does not return, and the file just gets larger.

Which is better for websites, lossy or lossless?

Lossy at a sensible quality for photos, lossless for graphics with sharp edges or transparency. WebP and AVIF can do both.

Summary: Use lossless for graphics and masters, lossy for web photos at a sensible quality, and never re-save a lossy file repeatedly. Compress with the free TinyPNG Now tool.