Skip to content
Tejo Tools
Search
Menu

How to compress an image without visible quality loss

Make a photo or a screenshot smaller in KB, and see where the quality setting starts to show.

Last updated

Open Compress images

What lossy compression leaves out

JPG and WebP are lossy formats. When a picture is saved in either of them, the encoder decides which details to keep and which to throw away, and whatever it throws away is gone for good. It works on small squares of the picture at a time. Inside each square it keeps the broad changes in brightness and drops the finest ripples, and it stores colour more coarsely than brightness, because the eye notices a change in light far sooner than a change in hue. The quality number decides how much is dropped. Near the top of the scale the encoder keeps almost every ripple and the file stays large. Further down it rounds more of them away. Each step down saves less than the one before, so the first cut is the big one: much of a photo’s size goes on detail too fine to see at the size it is shown. Saving a JPG again at a higher setting brings nothing back. Each save starts from the pixels as they are now, so a picture that has been saved many times carries the marks of every round.

Where the damage shows first

Compression marks don’t spread evenly over a picture. They gather in a few kinds of place, and those are the places to zoom in on when you compare a copy with its original:

  • Sharp edges and text. Faint ghost lines, called ringing, appear beside a dark letter on a light ground, or along a roof line against the sky.
  • Smooth gradients. A clear sky or a plain backdrop can break into bands or visible squares, because there is little texture there to hide the rounding.
  • Thin coloured lines. A fine red or blue line can bleed into its neighbours, since colour is kept at a coarser level than light. Busy areas such as leaves, gravel or fabric hide the same losses well. A photo of a forest can go much lower than a screenshot of a spreadsheet before anyone sees a difference.

Photos and screenshots compress differently

A photo and a screenshot react to compression in opposite ways. A photo is full of soft transitions and grain, which a lossy format handles well. A screenshot has large flat areas, hard edges and only a few distinct colours, which is exactly where a lossy format leaves its marks. PNG suits that second kind of picture. It is lossless: every pixel it stores comes back exactly as it was. Compress images can also merge the colours of a PNG into fewer, and a screenshot with a few hundred real colours hardly changes when they are merged. At the default Quality of 75 a PNG keeps up to 256 colours, a lower Quality keeps fewer, and the file’s card says how many it kept.

Worked examples

These use the two sample files of Compress images: photo.jpg, a photo of 1,200 × 800 px and 90.7 KB, and screenshot.png, a screenshot of 1,280 × 800 px and 105.0 KB. Try a sample on the tool loads both of them. Sizes are rounded as the file cards show them.

The photo at three Quality settings

At Quality 90 the photo comes back at about 90.6 KB, less than 1% smaller, so a setting that high saves next to nothing on this photo. At the default of 75 it is about 28.2 KB, 69% smaller, and at 40 about 13.5 KB, 85% smaller. All three copies stay 1,200 × 800 px. Moving from 90 down to 75 saves about 62.4 KB, while moving on from 75 to 40 saves only about 14.7 KB more, so the lower setting buys much less for the detail it drops.

The screenshot as PNG, WebP and JPG

Left as a PNG at Quality 75, the screenshot comes back at about 14.1 KB with 256 colours, 87% smaller, and its text keeps its hard edges. With Save as set to WebP it is about 25.5 KB, and with Save as set to JPG about 53.2 KB, almost four times the size of the PNG. For this picture the lossless format with fewer colours makes the smallest file of the three.

Comparing before you replace the original

A file size says nothing about how a picture looks. A few habits make the comparison fair:

  1. Open the original and the copy at the same zoom, 100% or closer, and look at the places listed above: edges, text and sky.
  2. Look at the picture at the size it will be seen. A photo shown as a small thumbnail can take a much lower setting than one printed across a page.
  3. Keep the original. The compressed file is a new copy, and detail that was dropped can’t be restored by saving again at a higher setting. In Compress images, moving the Quality slider compresses every file again, so you can step between two settings and read the cards side by side. Each card shows the size before and after and how much smaller the copy is.

When fewer pixels beat a lower quality

Lowering the quality is one way to shrink a file. Making the picture smaller in pixels is the other, and for a photo that will only be seen small it often saves more with no visible change, because the pixels that are left keep all their detail. How to resize an image to 20 KB or any size limit covers that route, and the File size option, which picks the quality for a limit in KB.

What else changes in the copy

The compressed file is built from the pixels alone, which leaves the camera model, the date and any location stored in the original out of it. Its name is the original’s with -compressed added, such as photo-compressed.jpg. The work happens in your browser, and the pictures aren’t uploaded.

Tools in this guide