Prompt LibraryPrompts
English

Image guides · 4 min read

How to Compress an Image Without Losing Quality

What lossless and lossy compression really do to a picture, which one to use for photos, screenshots and logos, and how to shrink a file without a visible change.

Nobody can make a file smaller for free in every case. What you can do is remove the parts of an image that nobody sees, and store the rest more efficiently. How much you can remove before it shows depends on the format and on what the picture contains.

Lossless and lossy are different jobs

Lossless compression stores exactly the same pixels in fewer bytes. Think of a ZIP file: unpack it and you get back precisely what went in. PNG works this way. A PNG that is recompressed with a better encoder looks identical because it is identical, down to the last value.

Lossy compression throws information away on purpose, choosing what the eye notices least. JPG and lossy WebP work this way. The saving is much larger, but it cannot be undone, and doing it twice makes the damage add up.

Where the "without losing quality" saving really comes from

A phone camera usually saves JPG files at a very high quality setting. Those settings keep detail that a phone screen cannot display and that nobody sees in print at normal size. Re-encoding such a file at a sensible quality can cut it roughly in half with no difference you can point to. The quality is not lost, it was never being used.

Three other things add weight without adding anything you can see:

  • Metadata. Camera model, settings, date, GPS position and often a small preview image stored inside the file.
  • Poor encoding tables. Many cameras and editors use generic tables rather than ones built for the picture.
  • Pixels you do not need. A 4000 pixel wide photo shown 800 pixels wide on a web page carries 25 times more pixels than the page can use.

Step by step with the Image Compressor

  1. Open the Image Compressor and add your JPG, PNG or WebP files.
  2. Leave the mode on Recommended. Photos are re-encoded at a quality that looks the same, and PNG files are recompressed without changing any pixel.
  3. Open the preview on one file, switch on Actual size, and drag the slider over an area with fine detail such as hair, text or a sky gradient. If you cannot tell the sides apart, you are done.
  4. Press Download, or Download all as ZIP for several files.

When you need a guarantee: lossless mode

If the file will be edited further, printed professionally or archived, use Lossless. For a PNG, the tool uses oxipng, which tries many ways of storing the same pixels and keeps the smallest. For a JPG, it decodes the compressed data and writes it again with Huffman tables built for that image, then drops metadata that is not needed to show the picture. The decoded pixels are identical to the original. The saving on a JPG is typically a few percent, more if the file has a lot of metadata, so do not expect miracles. That is the honest limit of lossless on a JPG.

Choosing a setting for each kind of image

  • Photographs: JPG or WebP at Recommended. Quality around 80 to 85 is hard to tell from the original at normal viewing size.
  • Screenshots, logos, diagrams, text: keep PNG. JPG makes sharp edges look fuzzy, and the file is often not even smaller.
  • Images with transparency: keep PNG or use WebP, which supports transparency as well.
  • Images you will edit again: keep the original, and use Lossless on copies.

Mistakes that really do lose quality

Compressing a file that was already compressed, over and over, is the main one. Each lossy save adds a little noise around edges, and after a few rounds it shows. Always start from the original file. The second mistake is shrinking too far: below a quality of about 60, blocky patches and smudged colour appear in smooth areas. If you must hit a size limit, see how to compress an image to 100 KB or 200 KB, which reduces dimensions before it ruins quality.

Finally, converting a photo to PNG does not improve it and usually makes the file several times bigger. See JPG, PNG or WebP for which format fits which job.

Keep reading

All articles