Open a PNG in any editor and the file is already compressed. PNG always compresses, and it always compresses losslessly. The first stage is filtering: for each row the encoder picks one of five filter types (None, Sub, Up, Average, Paeth) that predicts each pixel from its neighbours and stores the difference. Then DEFLATE, the same algorithm used in ZIP files, compresses the filtered bytes. Flat colour, sharp edges and repeated patterns make the prediction correct, so the differences are mostly zero and zeros compress to almost nothing. Photographic sensor noise makes the prediction wrong nearly every time, giving small random differences that are close to incompressible. That is the whole reason photos are huge as PNG.

JPEG is lossy. It discards high-frequency detail the eye is poor at noticing before compressing. PNG promised exact pixels, so it can never do that. The phrase lossless vs lossy png is really a question about whether you keep every original pixel or trade a few of them for a dramatically smaller file. Lossless optimisation searches harder for the best filter per row, re runs DEFLATE at maximum effort, and strips metadata chunks. The decoded pixels are identical. Typical saving is 5 to 15 per cent, sometimes zero on an already optimised file. Re encoding can produce a larger file than the original; a correct tool returns the original in that case.

Lossy PNG compression rebuilds the image from an adaptive palette of typically 256, 128 or 64 colours chosen from the colours actually present. Two compounding effects happen: each pixel needs 7 or 8 bits instead of 24 or 32, and thousands of near identical shades collapse into one entry, creating exactly the repetition DEFLATE feeds on. Typical savings for a UI screenshot are 70 to 85 per cent. Logo, icon or line art: 60 to 80 per cent. Chart or diagram: 70 to 80 per cent. Illustration with gradients: 40 to 65 per cent. Photograph stored as PNG: 40 to 70 per cent. Already optimised PNG: 0 per cent. Lossless only savings for the same types are 5 to 15 per cent, and 0 to 5 per cent for a photograph.

There are two visible failure modes of lossy compression. The first is banding in smooth gradients, because a soft fade needs many closely spaced colours to look continuous. The second is a stair step fringe on semi transparent edges: the soft alpha band around a rounded logo needs enough palette entries or it snaps into discrete steps. A gentler setting fixes it.

Is PNG Compression Lossy?

The answer is no for the format itself. PNG was designed from the ground up as a pixel perfect format. The compression inside a PNG file is always lossless. Every tool that writes a standard PNG preserves every red, green, blue and alpha value exactly as it was in the source image. If you open a PNG and save it again as PNG, the pixels you get back are the pixels you put in.

What people call lossy PNG is not a variant of the PNG format. It is palette reduction. A separate tool like pngquant or TinyPNG rebuilds the image using an adaptive palette of 256 or fewer colours, then saves that reduced image as a standard PNG. The file is still a valid PNG, but the original colour information is gone. That is why palette reduction cannot be undone. Keep the original and compress a copy.

Lossless Optimisation Tools

optipng and zopflipng do lossless optimisation. They try every filter for every row and run DEFLATE at its maximum setting. The output is byte identical to the input. ImageOptim on macOS bundles several of these lossless optimisers into one drop and drop action. GIMP's Export As dialog has a Compression level slider from 0 to 9. It is entirely lossless; level 9 is slower and gives a slightly smaller file. It does not reduce colours.

PNG 8 vs PNG 24

These names describe two different colour types that behave completely differently during compression. PNG 8 uses an indexed palette of up to 256 colours. PNG 24 uses truecolour with no alpha channel. PNG 32 is truecolour with an 8 bit alpha channel. The distinction is the same as lossless versus lossy wearing different names. If you are comparing PNG 8 vs PNG 24, you are comparing a palette based image that can drop from 24 or 32 bits per pixel to 8, against a truecolour image that keeps every shade.

For a screenshot with a few dozen distinct colours, PNG 8 easily matches the original look. The palette entries are chosen from the colours actually present, so flat areas remain flat. The file size drops by 70 to 85 per cent. For a photograph, PNG 8 introduces banding in every sky and shadow because 256 colours are not enough to cover the subtle gradients the human eye sees as continuous.

How to Use PNG 8 in Photoshop

Open File, Export, Export As. Tick the checkbox labelled Smaller File (8 bit). That switches the export to a 256 colour indexed palette, which is exactly palette reduction. For finer control use File, Export, Save for Web (Legacy). That panel gives a Colors dropdown from 2 to 256, a Dither slider, and a live file size readout. Save for Web is where you can go below 256 colours in Photoshop.

How to Use PNG 8 in GIMP

Go to Image, Mode, Indexed. Choose Generate optimum palette and set the maximum number of colours. Then export as PNG using File, Export As. The export dialog controls only lossless compression level and metadata stripping. The colour reduction happens in the Indexed step.

Adaptive Palette PNG

An adaptive palette is the engine behind every lossy PNG compressor. Instead of using a fixed set of colours like the old web safe palette, an adaptive palette analyses the actual colours in your image and picks the ones that appear most often. For a UI screenshot with a blue header, white background and three icon colours, the palette contains exactly those shades. No blue is wasted on shades of green that never appear. The result is a smaller palette that represents the image more accurately than any generic set could.

pngquant and TinyPNG both build adaptive palettes. The typical size is 256 colours, but you can go as low as 64 or even 2 for a simple logo. Each pixel needs 7 or 8 bits instead of 24 or 32, and thousands of near identical shades collapse into one entry, creating exactly the repetition DEFLATE feeds on. The savings compound.

For a photograph stored as PNG, palette reduction cuts the file by 40 to 70 per cent. Lossless only savings for a photograph are 0 to 5 per cent. That is the difference between a file that is still too large for the web and one that loads instantly.

Which Kind of PNG Compression Are You Using and Which Should You Use?

If you open a PNG in Preview on macOS and use File, Export, choosing PNG, you get a lossless file with no compression slider. Preview has no palette reduction. On Windows, Paint has no compression setting either. File, Save as PNG re saves the image exactly as it is. These tools are fine when the image is already small, but they will not shrink a photograph sized PNG.

If you open a PNG in Photoshop and use File, Export, Export As, the Smaller File (8 bit) checkbox activates palette reduction. That is lossy compression. The same applies in GIMP when you go to Image, Mode, Indexed before exporting. If you skip the Indexed step and export straight from Export As, you get a lossless PNG with only the metadata and compression level adjustments.

For a screenshot or graphic, use palette reduction. The savings are 70 per cent or more with no visible change on flat colour. For a photograph, do not use PNG at all. A photograph as PNG is roughly ten times the size of the same photo as JPEG at a quality difference invisible at normal viewing distance. If you must use PNG for a photo because you need transparency, palette reduction is still your best option, but expect some banding in gradients. For high quality prints, send the untouched original. Print resolution is far higher than screen and exposes banding invisible on a monitor.