Skip to content

Lossy vs Lossless Compression Explained

What compression actually throws away, why you usually cannot see it, and the point at which you can.

Lossless compression stores an image so it can be rebuilt exactly, while lossy compression permanently discards information the eye is unlikely to miss. That single difference is why a photograph can become 10 times smaller with no visible change, and why the same trick fails on a screenshot.

The catch with lossy compression is that the loss accumulates. Each save discards a little more, so opening and re-saving a JPEG repeatedly degrades it in a way that opening a PNG never does. Keep a lossless master, export lossy copies for delivery, and re-export from the master rather than from the copy.

What lossy compression actually removes

Lossy compression removes fine detail and subtle colour differences that human vision handles poorly. The choices are based on measured limits of perception rather than on guesswork.

Human eyes detect changes in brightness far more precisely than changes in colour, so JPEG stores colour information at reduced resolution and keeps brightness detail intact. The format also simplifies fine texture inside small blocks of the image, because a slightly smoothed patch of grass looks like grass while costing a fraction of the data.

How lossless compression works

Lossless compression finds patterns and describes them more briefly, without discarding anything. Rebuilding the file produces pixels identical to the original, byte for byte.

A row of 400 identical white pixels can be recorded as one instruction rather than 400 values, which is why flat colour compresses dramatically and photographic noise barely compresses at all. PNG works this way, as does WebP in its lossless mode, and so does the compression inside a ZIP archive.

Which formats are which

FormatTypeTransparencyBest for
JPEGLossy onlyNoPhotographs
PNGLossless onlyYesScreenshots, logos, diagrams
WebPBoth modesYesAlmost everything on the web
AVIFBoth modesYesLarge photographs
HEICLossy, lossless possibleYesPhone camera storage
GIFLossless, 256 coloursYes, single colourLittle, mostly replaced
BMPEffectively uncompressedLimitedNothing current

WebP and AVIF are the useful entries, since both offer either mode. One format can therefore handle a photograph and a logo correctly, which neither JPEG nor PNG can do alone.

Why repeated saving damages a JPEG

Each lossy save discards detail from an image that has already lost detail, and the damage compounds. The second save cannot recover what the first removed, and it removes more from what remains.

After 5 or 6 rounds the effect becomes visible as blockiness in smooth areas and halos around sharp edges. The problem appears most often with images shared repeatedly, since a photograph forwarded through several messaging apps may pass through 4 or 5 encodes before anyone edits it. Working from the original each time avoids the whole issue.

When lossy is the right choice

  • Photographs on a website, where a 70 percent size reduction is invisible to visitors.
  • Product images in a shop, where page speed affects sales directly.
  • Photos for upload forms, where a strict KB limit leaves no alternative.
  • Email images, where every kilobyte is downloaded on a phone.
  • Social media posts, where the network will recompress the file anyway.

When lossless is the right choice

  • Master files and originals that will be edited or re-exported later.
  • Screenshots and diagrams, where sharp edges and text suffer under lossy compression.
  • Logos and brand assets handed to other people for use in their own material.
  • Medical, legal and scientific images, where altered pixels may carry consequences.
  • Anything with transparency that must remain exact at the edges.

The quality setting explained

The quality number controls how aggressively detail is discarded, and it is not a percentage of anything meaningful. Quality 50 does not mean half the quality, and quality 100 does not mean lossless.

The number maps to how much the encoder simplifies each block of the image. JPEG at quality 100 still discards information, which is why the setting wastes space rather than preserving everything. Different formats use the scale differently, so WebP at 80 and AVIF at 60 both look comparable to JPEG at 85.

How to build a workflow that survives

To avoid accumulated damage across a library, follow these 5 rules.

  1. Keep the original camera or design file untouched, in a folder you never export from.
  2. Make edits on a lossless copy rather than on a delivered JPEG.
  3. Export delivery copies from the master every time, not from the previous export.
  4. Choose the delivery format by destination, using WebP for the web and JPG for forms and email.
  5. Re-export rather than re-compress when a new size or format is needed.

Rule 3 is the one most often broken. Re-compressing an existing export is faster in the moment and adds a generation of loss each time it happens.

Why a ZIP file does not shrink a JPEG

Compressing a folder of JPEG files into a ZIP archive saves almost nothing, because the images are already compressed. A ZIP of 200 photographs is typically 1 to 3 percent smaller than the photographs alone.

ZIP applies lossless compression, which works by finding repetition, and a lossy encoder has already removed most of the repetition available. The same folder as uncompressed BMP files would shrink dramatically, since nothing had been done to it yet. ZIP remains useful for bundling many files into one download, which is a convenience rather than a size reduction.

Can you tell how compressed an image is

Compare the file size against the pixel count, since a photograph well under 1 byte per pixel has been compressed heavily. A 1000 by 1000 photograph at 60 KB has been pushed hard, while the same image at 400 KB has not.

Visual inspection also works once you know where to look. Zoom to 100 percent and check smooth areas for faint square patches and sharp edges for halos. Both artefacts appear in exactly the same places regardless of which tool produced the file, so the inspection is quick and reliable.

Can lossy damage be repaired

No, discarded detail cannot be recovered, because the information is not stored anywhere in the file. Converting a damaged JPEG to PNG produces a larger file containing the same damage.

Some editing tools smooth JPEG artefacts, which hides the damage rather than reversing it and softens genuine detail alongside it. The only real fix is to return to the original file. That is the practical reason to keep masters, and the reason a folder of camera originals is worth more disk space than it costs.

Where the words appear in real tools

Software rarely uses the words lossy and lossless directly, offering a quality slider or an export preset instead. Knowing which one you are using matters more than the label attached to it.

  • A quality slider means lossy compression, whatever the format is called.
  • Save for web in design software means a lossy export at a preset quality.
  • Optimise or compress PNG means lossless reorganisation, unless colours are being reduced.
  • Export as PNG 8 means palette reduction, which alters the image permanently.
  • A KB target means the tool will lower quality until the file fits, so it is always lossy.

Applying the right mode across a library

Sort images into photographs and graphics first, then apply lossy compression to one group and lossless to the other. A mixed folder processed with one setting always damages half of it.

Drop up to 500 files in at once, set the quality and format for that group, and process the second group separately. Everything runs inside your browser on your own processor, so masters, client work and unpublished designs never reach a server. Because nothing is uploaded, the original files stay exactly where you left them and only the exports change.

Back to blog