getPNGgetSVG
File formats10 min read

How to compress an image without wrecking it

How to compress an image: get the format right first, then the one lever that actually shrinks a photo, a cutout or a screenshot.

The getPNG team27 Sept 2026

Short answer

To compress an image well, decide what it is first. A photograph with no transparent background compresses hardest as a JPG, on a quality slider. A cutout, logo or screenshot with transparency cannot use that slider at all, because JPG has nowhere to store an alpha channel, so its saving comes from resizing to the size it is shown at and cutting its colour palette instead. Getting that order backwards is the whole reason so many compressed pictures look worse for barely less weight.

Before you compress an image, answer one question: does it need to keep a transparent background? Everything else, which format it belongs in, which setting actually shrinks it, and how much smaller it can realistically get, follows from that single answer. Most disappointing results come from skipping it: running a photograph through a PNG optimiser that can only shave a few percent off, or running a cutout through a JPG “compressor” that quietly paints a white box behind it and calls that a save.

This guide is the decision the rest of getPNG’s compression guides sit underneath. It sets out the three cases that come up in practice, what actually makes each one smaller, and where to go next for the walkthrough that matches your picture.

The one decision that matters

What the picture is The right format Where the saving actually comes from
A photograph, no transparent background JPG The quality slider: detail the eye will not usually miss, thrown away a little at a time
A cutout with soft or hard edges PNG, or WebP for a website Resizing first, then a smaller colour palette. There is no quality slider, because nothing is being approximated
A screenshot, logo or flat graphic PNG, or WebP for a website Almost entirely the colour palette, because the picture already has very few colours in it

Only the first row has a slider in the everyday sense. The other two are shrunk by changing how many colours the file is allowed to use, which is a different kind of setting and behaves nothing like a JPG’s quality number. Treating a transparent PNG as if it needed a JPG-style slider is the single most common way to end up disappointed by “image compression.”

Get the format right before anything else

JPG and PNG solve different problems, and the full comparison of photo file formats has the detail on each one. The part that matters for compression is narrower: JPG has three numbers per pixel, for red, green and blue, and nowhere to put a fourth. It cannot store transparency in any version, at any quality, on any device. PNG, and WebP alongside it, carry a fourth number, alpha, that says how see-through each pixel is, which is what a transparent background actually is under the checkerboard.

So the format is not a preference to weigh against file size. If the picture has a transparent background, PNG or WebP are the only formats that keep it, whatever a compressor promises. If it does not, JPG almost always wins on size by a wide margin, because it was built for exactly this job and PNG was not.

The photograph: a quality number, chosen once

A photograph with no transparent background compresses on a single lever: the JPG quality setting, usually shown as a number or a percentage. Lower it and the file gets smaller by discarding fine detail in small blocks across the image, most of it in places a viewer is unlikely to look closely at. Push it too far and the blocks themselves become visible, especially around hard edges and text.

The setting that matters is chosen once, not repeatedly. Every time a JPG is opened, edited and saved again, another pass of that same discarding happens on top of what is already gone, which is why a photo forwarded through several apps often looks noticeably worse than the original despite nobody touching a slider on purpose. Keep an unedited original somewhere, compress a copy, and treat the result as the version you distribute rather than the version you keep editing.

The cutout: resize first, then the palette, never a slider

A cutout, a logo with a soft shadow, or anything else that has to keep a transparent background cannot go through a JPG quality slider at all, so the two levers that are left do all the work, and the order between them matters.

Resize first. This is worth more than any setting that comes after it on any format, because a compressor never has to touch a pixel that was removed before it started. Work out the largest size the picture will actually be shown at and scale down to that, keeping the original safely to one side; resizing is the one step here you cannot undo later.

Then reduce the colour palette. A PNG can store a colour per pixel, which is exact and heavy, or a table of up to 256 colours with one number per pixel pointing into it, which is what most of the size actually goes on. getPNG’s own compressor at /compress-png does this per file rather than by a fixed number: it works out what a full 256-colour palette would achieve on that particular picture and then takes the smallest palette that comes within a tenth of it, so a photographic cutout usually lands close to 256 and a simpler piece of artwork lands much lower on its own. How to reduce a PNG’s file size walks through that step in more detail, including doing it with Squoosh or pngquant if you are not already using getPNG for the cutout itself.

If the picture is going on a website rather than into a document or another app, WebP is worth considering alongside PNG once the resizing and palette work is done. PNG vs WebP for websites sets out when the swap is worth it and when a PNG stays the safer choice.

The screenshot: already close to right, so small moves finish it

A screenshot sits between the other two. It has no transparency to protect, but it is also not a photograph: it is mostly flat colour, sharp text and a small number of distinct shades, which is exactly the picture PNG’s lossless compression was designed around. That is why a screenshot often looks like it barely compresses at all when it is run through a tool built for photographs, and why a lossless pass on its own only trims a little more off the edges.

The bigger saving for a screenshot is the same palette step as the cutout, because a screenshot’s real colour count is usually far below 256 even though the file stores room for millions. Cutting the palette down to what the picture actually uses, alongside resizing away any pixels beyond what it needs to be shown at, does most of the work a screenshot has left to give up. Metadata, an unused alpha channel and a colour profile the picture does not need add a smaller amount on top, and a lossless optimiser strips those for free without changing a pixel.

Which images to compress first

Compressing the file in front of you is the easy half. The harder question is which files are worth the time, and on a website the answer is rarely the one you would guess. getReport’s image size checker measures a published page and names the pictures that are heavy, or saved far larger than they are displayed, or missing alt text. Compress those, leave the rest, and an hour goes a great deal further.

What none of this can do

Compression only removes what a file is not using well. It cannot bring back detail a camera never captured, sharpen a picture that was out of focus to begin with, or make an 800-pixel image look right at 4,000 pixels; that is a different job, covered in what AI upscaling can and cannot do. It also cannot make a bad decision good: a transparent picture forced into JPG loses the transparency permanently, and a photograph resized down loses those pixels for good too. Keep the original, and compress a copy.

Watch the palette answer the question for you

  1. Drop a photographic cutout with a soft edge, hair or fur is a good test, on /compress-png with the colour count left on Auto.
  2. Note the colour count shown next to the result.
  3. Compress a flat graphic instead: a logo or a screenshot with a handful of solid colours, the same way.

You should see: the photographic cutout lands close to 256 colours, and the flat graphic lands far lower, often 16 or 32, because that is genuinely how many colours each picture is built from. There is no single right number for “compress an image”: the right palette is different for every picture, which is why a tool that asks you to guess one is asking the wrong question.

If you do not: if the “flat” graphic also lands near 256, look for a soft drop shadow, an anti-aliased edge or a gradient in it. Those blend many colours together even where the picture reads as flat to the eye, and a quantiser counts every one of them.

The free way

The transparent half of this job

getPNG’s compressor handles the case a JPG slider cannot: drop a PNG, or a cutout you just made, and it works out the smallest colour palette that still matches that picture, with nothing to guess at, or searches for the largest palette that fits under a size you give it. It never resizes the picture behind your back, and it never hands back a file larger than the one it was given.

Your photo never leaves this device.Compress a PNG

The short version

Decide first whether the picture needs a transparent background. If it does not, it belongs in JPG and the quality number is the only lever worth touching, chosen once rather than re-saved repeatedly. If it does, JPG is off the table entirely, and the saving comes from resizing to the size the picture is actually shown at and then cutting its colour palette, in that order. A screenshot follows the same two steps as a cutout, because it is closer to flat artwork than to a photograph even though it never had any transparency to protect. Whichever case it is, keep the original before you start, because none of these steps can be undone once the file that had the extra detail is gone.

The steps, in short

  1. Work out what kind of picture it is. A photograph with a solid background compresses one way. A cutout, logo or screenshot with a transparent background compresses a different way, because only one of the two can survive losing that transparency.
  2. Get the format right before touching a slider. A photograph with no transparency belongs in JPG. Anything with a transparent background has to stay PNG or WebP; putting it in JPG does not compress it, it deletes the one thing that made the file worth keeping.
  3. Resize to the size it is actually shown at. Pixels you remove are pixels no compressor ever has to store. This one step is worth more than every setting that comes after it, on any format.
  4. Pick the lever for what is left. A JPG shrinks on a quality number. A PNG or WebP with transparency shrinks by cutting its colour table, because a quality slider has nothing to bite into when every pixel is already stored exactly.
  5. Check the edge, not just the file size. Zoom to 200 percent on a soft edge, hair or a shadow. That is where a compressor's damage shows first, well before the rest of the picture looks any different.

Questions

What is the best way to compress an image?

Decide what it is first. A photograph with no transparent background compresses on a JPG quality slider; a cutout, screenshot or logo that needs to keep transparency compresses by resizing it and reducing its colour palette, because JPG cannot hold transparency at all. Doing it in the wrong order, or in the wrong format, wastes the biggest saving available before you have touched a single setting.

Does compressing an image reduce quality?

A JPG quality slider does, by design: it throws away detail the eye usually does not notice, more of it as the number goes down, and more again each time the same file is re-saved. A PNG's own compression is lossless and changes nothing at all; what actually shrinks a PNG a lot is reducing its colours, which is a real change to the file but is usually not one you can see.

Should I compress a photo as PNG or JPG?

JPG, unless it needs a transparent background. A photograph saved as PNG typically comes out five to ten times larger than the same photo as a JPG for no visible gain, because PNG stores every pixel exactly rather than discarding the detail a JPG's quality setting is built to hide.

Why does compressing my screenshot barely change the file size?

Because a screenshot is already close to what PNG is good at: flat colour, sharp edges and a small handful of shades, so lossless compression alone gets most of the way there. Its size mostly comes from its resolution rather than a lack of compression, so resizing it, or cutting its colour palette down from 256 to the few it actually uses, does far more than running a lossless pass again.

How much smaller can I make an image without it looking different?

Resizing to the size the picture is actually shown at is the largest saving with the least risk, because nobody can see pixels that were never sent. Cutting a PNG's colour table to 256 colours or fewer, or saving a high-quality lossy WebP, are both usually next to invisible too. Past that point you are trading a visible loss for a smaller file, and it is worth deciding that on purpose rather than by accident.

Is a smaller file always a worse one?

No. A lossless PNG optimiser and a sensible colour reduction both shrink a file with nothing a viewer would ever notice missing. It only gets worse once a JPG's quality is pushed down past where its blocks start to show, or a palette is cut below what a soft edge needs to stay smooth rather than banded.

Tags
CompressionFile formatsPNGJPG
The getPNG team

We build the free background remover this site runs on, which works inside your browser so your photos are never uploaded. These guides come from the questions people ask while cutting pictures out, and every method in them was checked against the app it describes.

Linking to this guide?

If it helped with a tutorial, a class page or an answer you are writing, a link is the kindest way to say so. Here it is, ready to paste.

<a href="https://getpng.app/guides/how-to-compress-an-image">How to compress an image without wrecking it</a>
How to compress an image without wrecking it. getPNG, 27 Sept 2026. https://getpng.app/guides/how-to-compress-an-image

Keep reading

All guides