Rasp

File format

PNG

Lossless, transparent, and perfect for screenshots and graphics. Also, for photographs, enormous.

What is a PNG file?

A PNG is an image stored losslessly, meaning every pixel is preserved exactly as it was saved. It supports full transparency, including partially transparent pixels. That makes it ideal for screenshots, logos and diagrams, and a poor choice for photographs, where it produces very large files.

The facts

Full namePortable Network Graphics
File extensions.png
MIME typeimage/png
Introduced1996
Created byPNG Development Group, standardised by the W3C
CompressionLossless
TransparencySupported
SpecificationPortable Network Graphics (PNG) Specification, Third Edition

What lossless actually means

Every pixel you put into a PNG comes back out identical. Not visually identical — bit-for-bit identical.

That is a stronger guarantee than it sounds, and it is the whole reason to choose the format. Save a PNG, open it, edit it, save it again, repeat a hundred times: the image is exactly what it was. Do the same with a JPG and it degrades every time.

PNG achieves this by finding genuine patterns — runs of identical pixels, rows that resemble the row above — and encoding those efficiently with DEFLATE. Nothing is discarded, only described more compactly.

Why photographs make PNG enormous

Lossless compression can only exploit patterns that actually exist.

A screenshot has enormous amounts of exact repetition: flat backgrounds, identical letterforms, straight lines. PNG compresses that superbly.

A photograph has almost none. Every pixel differs slightly from its neighbour because of sensor noise and natural texture, and there is very little exact repetition to find. So PNG stores something close to the raw pixel data.

The measured gap is dramatic. On the fixed test image used across this site, the same picture was 3.97 MB as PNG and 375 KB as JPG.

What PNG is genuinely the right answer for

  • Screenshots, especially any containing text
  • Logos and icons, particularly against transparent backgrounds
  • Diagrams, charts and line art
  • Working copies you will edit repeatedly
  • Anything where a pixel being exactly right matters

Transparency is the reason PNG persists

PNG stores an alpha value per pixel, so transparency can be partial. A logo with soft antialiased edges composites cleanly onto any background colour, rather than showing a fringe.

That is why PNG remains ubiquitous in design and interface work even though WebP and AVIF now do the same thing in far smaller files.

Making a PNG smaller

Two routes, with very different characters:

Lossless optimisation rewrites the file’s compression without altering a single pixel. On our photographic test image it saved 15%; on screenshots and flat graphics it typically does considerably better. Nothing is damaged.

Converting to a lossy format saves far more. On the same test image, WebP was 94% smaller and AVIF 97% smaller. Both keep transparency. The cost is that text and hard edges soften slightly.

For screenshots of code or diagrams with fine hairlines, take the lossless route. For photographs that happen to be stored as PNG, convert without hesitation.

Convert PNG files

From PNG

To PNG

Questions

Is PNG lossy or lossless?
Lossless. Every pixel is stored exactly, and saving a PNG repeatedly never degrades it. This is the opposite of JPG, where every save discards a little more.
Why are PNG files so large?
Because lossless compression can only exploit patterns that genuinely exist. Photographs are full of fine, near-random variation with few exact repetitions, so there is little to compress. On our fixed test image the PNG was 3.97 MB where the JPG was 375 KB.
Does PNG support transparency?
Yes, including partial transparency. Each pixel carries an alpha value, so soft edges and drop shadows composite cleanly against any background. This is the main reason PNG persists on the web.
Should I use PNG or JPG for screenshots?
PNG. Screenshots are full of text and sharp edges, which is precisely what JPG compression damages — you get visible haloing around letters. PNG stores them exactly.
How do I make a PNG smaller?
Two options with very different results. Lossless optimisation rewrites the compression without touching a pixel, typically saving 10-30%. Converting to WebP or AVIF is lossy but saves far more — on our test image, 94% and 97% respectively.
What is the difference between PNG and GIF?
PNG supports 16 million colours and partial transparency; GIF is limited to 256 colours and a single fully-transparent colour. PNG was created in 1996 specifically to replace GIF, partly over a patent dispute about GIF's compression. GIF survives only for animation.
Is PNG good for photographs?
Only as an editing or archival format, where its losslessness matters and file size does not. For sharing or publishing a photograph, PNG is the wrong choice by a wide margin.
Does PNG support animation?
APNG does, and every current browser supports it, but it is a later extension rather than part of the original format and support outside browsers is patchy.

Sources