Compression5 min read·Updated

Lossy vs Lossless Compression: Which Should You Use?

Use lossy compression (JPEG, lossy WebP or AVIF at quality 75–85) for photos you publish or send: the files are typically 5–10 times smaller than lossless ones and look the same at normal size. Use lossless compression (PNG, lossless WebP, TIFF) for files you will edit again, screenshots and text, pixel art, and scans that must stay exact, such as medical images or legal documents.

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?

FormatModeWhat is lostBest for
JPEGLossyFine texture, color resolution (usually 4:2:0), accuracy inside 8 × 8 blocksPhotos for the web, email and upload forms
PNG (24- or 32-bit)LosslessNothingScreenshots, UI, graphics with text, editing copies
PNG-8 (palette)Lossless file; reducing the colors is lossyColors beyond the 256 kept in the paletteLogos, icons, flat illustrations
WebP (lossy)LossyFine texture and color resolution (always 4:2:0)Photos on websites
WebP (lossless)LosslessNothingScreenshots and graphics on websites
AVIFLossy (a lossless mode exists but is rarely used)Fine texture; grain may be smoothedPhotos where the smallest file matters
HEICLossyFine texturePhoto storage on iPhone
GIFLossless, limited to 256 colorsColors beyond 256 when converting a photoSimple animations (animated WebP is smaller)
TIFFUsually lossless (LZW or ZIP)Nothing in lossless modesPrint 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?

  1. Will you edit it again? Keep a lossless master, then make lossy copies from it.
  2. Is it a photo going to a website, an email or a form? Lossy JPEG or WebP at quality 75–85.
  3. Is it a screenshot, a chart or anything with small text? Lossless PNG or WebP, or lossy at 90 and above.
  4. 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.
  5. 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.

Quality 100 is not lossless
In JPEG and lossy WebP, quality 100 still converts colors and still rounds values, so it is not a lossless mode. It produces files three to five times larger than quality 80 with no visible gain. If you need exact pixels, choose PNG or lossless WebP.
Compress JPG, PNG or WebP in your browser. If a file cannot get smaller, you keep the original.

Put it into practice

Compress your images right now: keep the format or set a target size, free and privately in your browser.

Open the compressor

Frequently asked questions

Yes, the PNG format is always lossless. But most PNG compressors first reduce the image to a palette of 256 colors or fewer, which is a lossy step, and then save that result losslessly.

Both. WebP has a lossy mode for photos and a separate lossless mode for graphics, and both support transparency. The .webp extension does not tell you which mode a file uses.

Yes. JPG is lossy, so some detail is rounded away, and any transparency is replaced by a solid background. For photos the loss is invisible at quality 80–85; for screenshots and logos it often shows.

For photos, yes, usually by 5 to 10 times. For flat graphics, screenshots and logos, lossless PNG or WebP is often as small as a JPEG or smaller, and it keeps text sharp.

Keep reading

Compression6 min read

What is image compression

Image compression shrinks files by storing pixels more efficiently (lossless) or dropping detail you barely see (lossy). How JPEG, PNG, WebP and AVIF do it.

Read more
Compression5 min read

Does compression hurt quality?

Lossy compression removes data, but at quality 75–85 the change is invisible at normal size. What artifacts look like, which images show them, and how to check.

Read more
Compression5 min read

Smallest image format

AVIF makes the smallest photos, then WebP, then JPEG. Flat graphics: lossless WebP or PNG-8. Logos: SVG. Animations: WebP or AVIF instead of GIF.

Read more