What is the difference between lossy and lossless compression?
Lossless compression stores the image more efficiently but gives back exactly the same pixels when the file is opened: you can decompress and recompress it a thousand times without change. Lossy compression rounds away detail that is hard to see, so the decoded image is close to the original but not identical, and the quality setting decides how close. For photos the size gap is large: a 1600 × 1200 photo typically weighs 2.5–4 MB as PNG and 280–360 KB as a JPEG at quality 80. For flat graphics the gap shrinks, and lossless often wins outright. How each method works is explained in what is image compression.
Which formats are lossy and which are lossless?
| Format | Mode | What is lost | Best for |
|---|---|---|---|
| JPEG | Lossy | Fine texture, color resolution (usually 4:2:0), accuracy inside 8 × 8 blocks | Photos for the web, email and upload forms |
| PNG (24- or 32-bit) | Lossless | Nothing | Screenshots, UI, graphics with text, editing copies |
| PNG-8 (palette) | Lossless file; reducing the colors is lossy | Colors beyond the 256 kept in the palette | Logos, icons, flat illustrations |
| WebP (lossy) | Lossy | Fine texture and color resolution (always 4:2:0) | Photos on websites |
| WebP (lossless) | Lossless | Nothing | Screenshots and graphics on websites |
| AVIF | Lossy (a lossless mode exists but is rarely used) | Fine texture; grain may be smoothed | Photos where the smallest file matters |
| HEIC | Lossy | Fine texture | Photo storage on iPhone |
| GIF | Lossless, limited to 256 colors | Colors beyond 256 when converting a photo | Simple animations (animated WebP is smaller) |
| TIFF | Usually lossless (LZW or ZIP) | Nothing in lossless modes | Print masters, scans, archives |
What is generation loss?
Generation loss is the damage that builds up when a lossy file is decoded, edited and saved again. Every lossy save rounds the image afresh, and the errors add up. Re-saving an untouched JPEG at the same quality loses relatively little after the first couple of rounds, but cropping, resizing or color edits shift the content against the 8 × 8 block grid, so each save starts a fresh round of rounding. Converting between lossy formats (JPEG to WebP, or WebP back to JPEG) also counts as a new generation. After many rounds, detail goes soft, blocks get stronger and colors drift.
- Keep a lossless master: the camera original, the RAW file, a PSD, or a PNG or TIFF export.
- Export lossy copies once, from the master, for each use.
- When you must recompress a JPEG, stay at quality 80–88 rather than going lower, and do it once.
- Never “upgrade” a JPEG by saving it as PNG: the PNG stores the existing artifacts exactly and is typically 5–10 times larger.
When is lossless compression mandatory?
- Masters and working files. Anything you will edit again (layered PSD, TIFF, PNG exports for a designer) should stay lossless so edits do not stack losses.
- Medical and scientific images. Diagnosis and measurements are made on pixel values. Follow the rules of the system or institution, which often require lossless storage or allow lossy compression only under specific conditions.
- Legal, archival and evidence scans. When a scan may serve as a record or as evidence, keep the file exactly as captured and make lossy copies only for sharing. Archives commonly keep master scans as uncompressed or losslessly compressed TIFF.
- Pixel art and sprites. Every pixel is intentional. Lossy formats blur hard edges and shift colors; use PNG or lossless WebP, and scale with nearest-neighbor.
- Screenshots with small text, code and diagrams. Lossy compression leaves halos around letters, so use lossless PNG or WebP, or lossy at quality 90 and above.
- Images that machines must read. Small QR codes, barcodes and documents meant for OCR tolerate little blur.
What does “visually lossless” mean?
“Visually lossless” describes lossy compression whose errors stay below what a viewer notices at the intended size. It is a practical claim, not a technical guarantee: there is no fixed quality number behind it, and an image that looks lossless on a phone can show artifacts at 200% zoom on a monitor. In practice, quality 80–90 is visually lossless for most photos at normal viewing size, while screenshots and text need 90 or more, or true lossless. Engineers measure it with metrics such as SSIM or Butteraugli; you can check it yourself by comparing the two files side by side at 100% zoom. See does compressing images reduce quality for what the artifacts look like.
How do you choose between lossy and lossless?
- Will you edit it again? Keep a lossless master, then make lossy copies from it.
- Is it a photo going to a website, an email or a form? Lossy JPEG or WebP at quality 75–85.
- Is it a screenshot, a chart or anything with small text? Lossless PNG or WebP, or lossy at 90 and above.
- Is it a logo or an icon? SVG if you have it, otherwise PNG-8 or lossless WebP; see the smallest image format for each case.
- Does the destination require JPG? JPG at 80–85, exported once from the master.
The compressor covers both sides. JPG and WebP files are compressed lossily with a quality slider from 1 to 100. PNG files stay PNG: the tool reduces their colors to a palette of up to 256, which keeps transparency and typically removes 60–80% of the size, and at quality 95 or above it re-encodes the PNG losslessly instead. Try it on a PNG to see how far a palette goes before any difference shows.