Best for: Photographs, complex images with gradients, anything where file size matters more than perfect fidelity.
How it works: Lossy compression—throws away data the human eye barely notices. You choose the quality/size tradeoff (0–100%). At 80–90%, most photos look identical to the original at a fraction of the size.
Limitations: No transparency. Repeated saving degrades quality (generation loss). Bad for sharp edges, text, or flat-color graphics—compression artifacts create ugly halos.
Best for: Logos, icons, illustrations, screenshots, UI elements, anything with transparency or sharp edges.
How it works: Lossless compression—zero quality loss. Supports alpha channel transparency (partial opacity, not just on/off). Handles flat colors and crisp lines perfectly.
Tradeoff: Files are 2–10x larger than equivalent JPEGs. Not ideal for photos unless you need absolute fidelity.
WebP and AVIF are the future—better compression for both use cases—but JPEG and PNG remain the universal baseline every browser supports.