Lossy vs Lossless Compression: The Difference
Lossy vs lossless image compression explained with real examples: how much smaller files get, what you lose, and which to use for photos or graphics.
By Mudasir Ahsan (Founder) · · Updated · 8 min read
Facts checked against official sources on
On this page
The difference in lossy vs lossless compression is whether anything is thrown away. Lossless compression makes an image file smaller without changing a single pixel: decompress it and you get back exactly what you started with. Lossy compression makes the file much smaller by permanently discarding detail people are unlikely to notice. Use lossy (JPEG, or lossy WebP or AVIF) for photos. Use lossless (PNG, or lossless WebP) for screenshots, logos and anything with sharp edges or text.
Photo: George Milton on Pexels
How does image compression save space?
An uncompressed image stores a color value for every pixel. A 12-megapixel photo has 12 million pixels, each needing three bytes for red, green and blue, so stored raw it would take roughly 36 MB. Nobody shares photos that way, because much of that is waste. It comes in two kinds.
One is repetition. A blue sky, a white document background or a flat-colored logo contains long runs of identical or predictable pixels. Saying "the next 400 pixels are white" takes far less space than listing 400 white pixels. Removing this waste loses nothing.
The other is detail the eye ignores. Human vision is much more sensitive to brightness than to fine color changes, and it struggles with tiny variations in busy textures such as grass or hair. Throwing that detail away makes files far smaller. It's also gone for good.
Lossless compression removes only the first kind. Lossy compression removes both.
What is lossless compression?
It works like a ZIP file for pictures. An encoder finds patterns and stores them more efficiently, and a decoder rebuilds the original exactly. You can edit and re-save a losslessly compressed image as often as you like. It never gets worse.
PNG is the usual example, and the ZIP comparison is nearly literal. PNG filters each row of pixels to make it more predictable, then compresses the result with DEFLATE (RFC 1951), which is also one of the standard compression methods in ZIP files. Its specification describes the filtering step as "deterministic, reversible, and lossless".
GIF shows that "lossless" and "looks good" are separate questions. It uses LZW compression on images limited to a palette of up to 256 colors. The compression itself loses nothing. Converting a full-color photo into 256 colors does, and that's why photos saved as GIF look grainy or banded.
Lossless WebP and lossless AVIF are newer options that support full color and transparency. Google reports that lossless WebP images are 26% smaller than PNGs.
Size is the weak point. A photo's natural noise and texture contain few exact repeats, so a lossless photo stays large. Graphics with flat color are full of repeats, and that is where lossless does best.
How much a lossless re-save gains also depends on how carefully the file was saved the first time. A PNG written quickly by a screenshot tool, or by an app with light compression settings, can often be squeezed a lot further with the same pixels. One that was already optimized will barely change.
What is lossy compression?
Lossy compression goes a step further and removes detail. Take JPEG. Its encoder splits the image into 8 × 8 pixel blocks, converts each block into a description of its patterns, then rounds off the fine detail according to a quality setting. Lower quality means more rounding and a smaller file.
At sensible settings the losses are hard to see at normal viewing size. Push too far and the familiar signs appear:
- Blocky squares in smooth areas such as skies.
- Halos or "mosquito noise" around sharp edges and text.
- Smudged fine textures and color bleeding.
Those squares are the 8 × 8 blocks showing through. Our guide to JPEG artifacts shows what each one looks like and how to avoid it.
Two habits keep lossy compression safe.
Compress once, from the best original. Every lossy save throws away a little more, so a JPEG that is edited and re-saved again and again slowly degrades. Keep the original and export a compressed copy at the end.
Resize before you compress. Reducing a 4000-pixel photo to the size it will be shown at removes far more data than any quality setting, without the artifacts. Our guide on how to reduce image file size explains the order of steps.
How much smaller does each kind make a file?
We ran our test images through our own upload pipeline (sharp/libvips, the same processing every PictureToLink upload goes through). These are measurements on our sample files. Your images will give different numbers.
A screenshot (PNG, 1366 × 900, 2.38 MB)
| Method | Type | Result | Saved |
|---|---|---|---|
| Re-saved as PNG with maximum compression | Lossless | 712 KB | 69.3% |
| PNG reduced to a color palette | Lossy (fewer colors) | 525 KB | 77.4% |
| Converted to WebP at quality 75 | Lossy | 108 KB | 95.5% |
A lossless re-save cut the file by more than two thirds with identical pixels. That tells you the original was saved loosely. Lossy WebP was far smaller again. For a screenshot people will only glance at, take the WebP. For a screenshot of fine text that must stay crisp, the lossless PNG is safer.
Lossless WebP is a third option. Our 1440 × 900 screenshot of plain text went from 137,357 bytes to 29,614 bytes as WebP (78.4% smaller), and our pipeline kept it lossless.
A photo (JPG, 3000 × 2000, 985 KB)
Our pipeline stores uploads at up to 1920 px on the longest side, so every result below is 1920 × 1280, and the "Saved" column includes that reduction.
| Method | Type | Result | Saved |
|---|---|---|---|
| Re-encoded as JPEG at quality 85 | Lossy | 504 KB | 48.8% |
| Re-encoded as JPEG at quality 75 | Lossy | 370 KB | 62.4% |
| Re-encoded as JPEG at quality 65 | Lossy | 301 KB | 69.5% |
| Converted to WebP at quality 75 | Lossy | 301 KB | 69.4% |
Smaller pixel dimensions explain much of each saving. 1920 × 1280 is 41% of the original pixel count, and even quality 85 nearly halved the file. Each step down in quality then cut it further. By byte count, quality 75 was 26.6% smaller than 85, and 65 was another 18.7% smaller than 75. WebP at quality 75 came out almost exactly the same size as JPEG at 65.
What the results show
On graphics, lossless compression alone can make a big difference, and lossy formats go much further. On photos, resizing does the most work. A lower quality setting or a newer format then saves more on top.
Don't assume the newer format wins, though. Results vary from image to image. In the same tests, both stored at 1920 px, a different 3024 × 2016 photo came out 51% larger as WebP at quality 75 than as JPEG at the same setting. For a 4032 × 2623 landscape photo, the WebP was 34.5% smaller. Always check the result.
To try this on your own files without uploading them, use the image compressor. It runs in your browser and shows the size before and after. Choose PNG for lossless output, or JPG or WebP with a quality slider for lossy output.

A lossy save at quality 75. The original files stay untouched.
Which image formats are lossy and which are lossless?
| Format | Lossless | Lossy | Transparency | Animation |
|---|---|---|---|---|
| JPEG | No | Yes | No | No |
| PNG | Yes | No (palette reduction is a lossy pre-step) | Yes | Yes (APNG) |
| GIF | Yes, but limited to 256 colors | No | On/off only | Yes |
| WebP | Yes | Yes | Yes | Yes |
| AVIF | Yes | Yes | Yes | Yes |
For the details, the MDN image format guide is a reliable reference. It confirms that GIF is limited to a palette of up to 256 colors, and that WebP and AVIF offer lossy and lossless encoding as a setting you choose. Animated PNG (APNG) became part of the official PNG specification with the W3C's third edition, published in June 2025. Our guide to image file formats compares all of them side by side.
Should I use lossy or lossless compression?
Photos get lossy compression. JPEG at a quality around 75 to 85 is a safe default that works everywhere, and WebP or AVIF can be smaller where they are supported. Resize to the display size first.
Screenshots depend on what is in them. For text, code or interfaces where crispness matters, use PNG (lossless). For screenshots of photos, video frames or games, lossy WebP or JPEG is fine and much smaller.
Logos, icons and line art should stay lossless, as PNG or lossless WebP. Lossy compression smears the sharp edges and flat colors that make a logo look clean. If you have a vector version (SVG), that is often better still on a website.
Transparency narrows the choice to PNG, WebP or AVIF. JPEG has none, so transparent areas turn into a solid background when you convert.
Keep archive copies lossless, along with any original you will edit later, or keep the camera original. Export lossy copies only for sharing.
Reddit takes either kind. JPG, PNG and GIF are the safest formats to upload there, so a lossy JPG for a photo and a lossless PNG for a screenshot both fit. Our guide to posting images on Reddit has the steps.
Frequently asked questions
Is a PNG always lossless?
The PNG format is, but a PNG can have lost information before it was saved. Tools that shrink PNGs by reducing them to a palette of fewer colors (our "Smallest file" setting does this) make a lossy change first and then save it losslessly. A PNG made from a JPEG also keeps every JPEG artifact.
Can I turn a lossy image back into a lossless one?
No. Saving a JPEG as PNG preserves what is left, artifacts included, in a bigger file. The discarded detail cannot be recovered, which is the reason to keep your originals.
Does uploading to a website compress my image again?
Often, yes. Many platforms re-encode uploads with their own lossy settings. PictureToLink does too, with a choice of "High quality", "Balanced" or "Smallest file". For the least change, choose "High quality" and upload your best original, not a copy that has already been compressed.
