Lossy vs Lossless Image Compression: What Actually Changes
Lossless keeps every pixel; lossy throws some information away on purpose. Learn how JPEG does it, why repeated saves degrade a file, and when each is right.
Every image format has to solve the same problem: raw pixel data is large, and files need to be smaller. There are two fundamentally different ways to get there. One reorganises the data so it takes less space and can be restored exactly. The other decides that some detail is not worth keeping and discards it. The difference sounds academic until you save the same JPEG five times and wonder why it looks worse.
Lossless: smaller, but identical
Lossless compression works like a well-packed suitcase. Nothing is thrown away; the same contents simply take up less room. When the file is opened, every pixel comes back with exactly the value it had before.
PNG is the common example. It finds patterns and repetition in the pixel data and encodes them more compactly, and it also supports transparency. Flat colours, sharp edges, text and screenshots compress especially well because they are full of repetition. WebP also has a lossless mode that keeps every pixel. A photograph, by contrast, has subtle noise in almost every pixel, so a lossless file of a photo can stay large.
Because nothing is discarded, you can open and re-save a lossless file as many times as you like and get identical pixels each time.
Lossy: smaller, because something is gone
Lossy compression is a deliberate trade. It exploits the fact that human vision is more sensitive to some changes than others, and it discards information you are least likely to notice. The result is usually much smaller than a lossless file of the same photo, but the discarded detail cannot be recovered.
JPEG is the classic lossy format, and WebP and AVIF both offer lossy modes too. A quality setting controls how aggressive the discarding is: higher quality keeps more, lower quality keeps less and produces a smaller file.
How JPEG discards information
JPEG works in several steps, and knowing them explains most of the artefacts you see.
- Colour is separated from brightness. The image is converted so brightness (luma) and colour (chroma) are stored separately. Our eyes resolve brightness detail better than colour detail.
- Chroma can be subsampled. Because colour detail matters less, the encoder can store colour information at a lower resolution than brightness. This is called chroma subsampling, and it is one reason thin coloured edges, such as red text on a coloured background, can look smeared in a JPEG.
- The image is cut into 8 x 8 pixel blocks. Each block is transformed so it describes patterns, from broad gradients to fine detail, rather than individual pixels.
- Quantisation removes detail. This is the step that is actually lossy. The fine-detail values are divided and rounded so many become zero. A lower quality setting rounds more harshly.
- The remaining values are compressed losslessly to write the file.
Since quantisation works block by block, heavy compression can leave visible 8 x 8 squares, often called blocking, and fuzzy noise around sharp edges. That is why JPEG suits photographs, where detail is soft and complex, and struggles with crisp text and line art.
Generation loss: why re-saving hurts
Each time you open a JPEG, edit it and save it as a JPEG again, the encoder runs the whole process a second time, on pixels that already carry the errors of the first. Small differences pile up. This gradual degradation is called generation loss.
It is easy to avoid with a few habits:
- Keep the original file, and always start from it rather than from a copy you already compressed.
- Do all your editing first and export a JPEG once at the end.
- If you need to keep editing, work in a lossless format such as PNG and only convert to JPEG for the final output.
- Re-uploading a photo to a service that recompresses it adds another generation you cannot control, so start from a clean high-quality file.
Choosing between them
| Situation | Better choice | Why |
| Photograph for a web page | Lossy (JPEG or WebP) | Photos hide the discarded detail well and files are much smaller |
| Screenshot, logo, diagram | Lossless (PNG) | Sharp edges and flat colour stay clean and compress well |
| Needs transparency | PNG, or WebP | JPEG has no alpha channel |
| Master copy you will edit again | Lossless | No generation loss |
| Final image sent by email | Lossy at moderate quality | Small file, the edits are finished |
For a wider comparison of the formats themselves, see JPEG, PNG, WebP or AVIF: which image format to use. If you want a feel for how far quality can drop before it shows, how much can you compress an image works through that question, and why images slow down your website explains why the file size is worth caring about at all.
How the Synthixx tools behave
The Image Compressor runs in your browser and does not upload the image. It has an output format choice: keep the original, or JPEG, WebP, and AVIF only where your browser can encode it. The quality slider applies to JPEG and WebP output only. If the file stays PNG, it is lossless, so the slider changes nothing, and the tool suggests capping the dimensions or switching to WebP or JPEG if you need a smaller file. Choosing JPEG output flattens any transparency onto a white background, because JPEG cannot store it. The tool handles one image at a time and can also cap the maximum width and height.
The Image Converter changes format to PNG, JPEG or WebP, and AVIF only if your browser supports encoding it. Converting a JPEG to PNG does not restore lost detail; it just stores the already-degraded pixels losslessly, so the file often grows without looking better.
A simple rule of thumb
Keep a lossless or original copy, and treat lossy compression as the last step, done once. Use lossy for photographs going onto pages and into messages, lossless for graphics, text and anything you will edit again. When the slider is available, lower the quality gradually and look at the result at the size it will actually be viewed; stop at the first setting where you start to notice a difference, then go one step back up.