What image compression is, how lossless and lossy differ, and when to use JPEG, PNG, or WebP without wrecking quality.
· Updated

A raw phone photo can sit at several megabytes. The same shot on a website is often under 500 KB.
Image compression is how that gap closes. Software rewrites the file so it uses fewer bytes while still looking good enough for the job.
There are two main modes: lossless (exact pixels back) and lossy (smaller files, some detail gone for good). The rest of this post explains both, then JPEG, PNG, and WebP in plain terms.

Image compression is any process that stores the same picture with less data.
A digital image is a grid of pixels. Each pixel stores color values. Without compression, a 4K frame can approach 25 MB of raw RGB. Formats like JPEG and PNG exist so you do not ship that raw grid around.
Compression does not invent new detail. If a photo is already too small for a big print, compressing it will not fix that. Check dimensions first with an image resolution checker, then shrink file size.
Lossless image compression reduces size without changing a single final pixel after decode.
You compress, then open again, and the grid matches the original. That matters for:
PNG is the common lossless web format. Lossless WebP can do a similar job with smaller files in many cases.
Lossless methods look for patterns. One simple idea is run-length encoding: store “200 white pixels” instead of 200 separate white values. Real codecs use smarter tables and filters, but the idea is the same: rewrite, do not discard.

Tradeoff: lossless files stay larger than a well-tuned JPEG of the same photo. Use lossless when exact edges matter more than the smallest possible size.
Lossy image compression throws away information on purpose to get much smaller files.
JPEG and lossy WebP do this. They keep brightness detail the eye notices and soften color detail the eye often misses. That is why a holiday photo can drop from 8 MB to under 1 MB and still look fine on a phone screen.

Tradeoff: each hard re-export at low quality can add blur or blocks. Export once from a master when you can. For a one-off online pass, try Compress JPG and check the result side by side.
JPEG is still the default for photos on many sites. In rough order:
You do not need the math to use it. You need a quality setting that looks good on a real screen, then stop re-saving the same JPEG over and over.

For a longer format compare, see modern image formats.
| Goal | Mode | Typical format |
|---|---|---|
| Exact pixels | Lossless | PNG, lossless WebP |
| Small photo files | Lossy | JPEG, lossy WebP |
| Transparency + sharp UI | Lossless | PNG |
| Modern web delivery | Often lossy WebP / AVIF | with fallbacks if needed |
Image compression is a trade: bytes versus fidelity. Lossless keeps every pixel. Lossy buys size by dropping hard-to-see detail. Pick the mode for the job, check the result once, and keep a master copy of important originals.
If you want that workflow offline on Mac or Windows for whole folders, download Compresso and compare file sizes on your own photos.