PNG

What is a PNG file?

Lossless raster format with transparency. The safe choice for screenshots, logos and line art.

What PNG is

PNG is a binary format, meaningful only to a program that knows it. It stores a grid of pixels, so enlarging it past its own resolution softens it. It is used for screenshots, line art and logos and the web.

The extension is .png, and the full name is Portable Network Graphics. Both matter less than what the file can hold, which is what the rest of this page is about.

Where PNG came from

PNG Development Group published it in 1996. The specification is ISO/IEC 15948.

A format that has been readable for that long is a format worth trusting with something you want back in ten years.

The specification is public

It is published in full, so anyone can implement it from the document rather than by inspection, which is why it turns up in so many programs and why files written twenty years ago still open. A published specification is not the same thing as a royalty-free one: where a format wraps a codec, the patent licensing is a separate question the standard does not settle.

Nothing is thrown away

PNG stores its content exactly. Saving it again changes nothing, so it can be opened, edited and re-saved as often as you like without accumulating damage — which is what makes it a working format rather than a delivery one.

It can be transparent

PNG carries an alpha channel, so a logo keeps its soft edges over whatever sits behind it instead of arriving in a white box.

Colour it can describe

Up to 16 bits per channel. It can work in RGB, greyscale and an indexed palette.

More than eight bits per channel is what stops a gradient from stepping when it is edited, which is why it matters in a working file and rarely in a finished one.

What it does to protect itself

PNG carries a checksum, so a damaged file is detected rather than silently mis-read.

A checksum will not repair anything. It tells you the file is wrong, which is the difference between finding out now and finding out from whoever you sent it to.

What opens PNG

Adobe Photoshop, GIMP and Paint.NET read it, and so do most programs of the same kind.

If a file will not open, the format is rarely the problem — it is more often that the program predates it. Converting to something older is the reliable way past that, and it is what the rest of this site is for.

Opening it in a browser

Every current browser reads it.

That makes it a safe thing to put on a page or attach to a message without wondering what the other end has installed.

What it can carry besides the content

PNG can hold EXIF, XMP and ICC profiles.

Whether any of it survives a conversion depends entirely on the target, and the honest answer is usually "some of it".

It is a delivery format

PNG is meant to be handed over rather than worked in. Editing one is possible and rarely pleasant; the sane approach is to change the source and export again.

What goes wrong with it

The recurring complaints: the files are large for what they contain.

None of these is a reason to avoid the format. They are the things worth knowing before you are surprised by one, which is a different claim and a more useful one.

The size depends on what is in it, not how big it is

PNG compresses losslessly by finding structure — runs of identical pixels, rows that resemble the row above, gradients that change predictably. So a 4000-pixel screenshot of a mostly white document can be smaller than a 800-pixel photograph of leaves, because one is full of repetition and the other is full of noise.

That is the opposite of how JPEG behaves and it is the source of most surprise about the format. If a PNG is unexpectedly enormous, the answer is almost always that the content is photographic; if it is unexpectedly tiny, the content is flat. Dimensions barely enter into it.

Lossless means the pixels come back exactly

Decompress a PNG and every pixel has precisely the value it had going in. Save it a hundred times and nothing degrades, because nothing was thrown away — which is the whole difference from JPEG and the reason PNG is the right working format for anything being edited repeatedly.

It also means converting a JPEG to PNG improves nothing. The damage the JPEG encoder did is already in the pixels, and PNG faithfully preserves it in a larger file. Lossless describes what happens from now on, not a repair of what happened before.

It exists because of a patent dispute

In 1994 Unisys began enforcing patents on the LZW compression inside GIF, and software that wrote GIFs suddenly needed a licence. The response was a format designed in the open over the following months, published as a specification anyone could implement, and deliberately free of encumbrance.

PNG shipped in 1996 with better compression than GIF, 16 million colours instead of 256, and proper transparency. The patents ran out between 2003 and 2006 — the US one first, the foreign counterparts in 2004, IBM’s in 2006 — and by then the argument was over. It is one of the clearer cases of a licensing problem producing a better technical answer.

Transparency that has gradations

GIF transparency was one bit: a pixel was either fully opaque or fully invisible, which produced hard jagged edges on anything curved. PNG has a full alpha channel — 256 levels of opacity per pixel — so edges can be genuinely soft and a shadow can fade to nothing.

This is why PNG became the format for logos, icons, cut-out product shots and anything meant to sit over an unknown background. It is also the property that is destroyed silently by converting to JPEG, which has no alpha channel and fills those areas with solid white.

Eight bits per channel, and where that runs out

PNG here is written at 8 bits per channel — 256 levels each, 16.7 million colours. That is more than enough for anything being viewed, and it is less than a camera raw file or a 16-bit TIFF carries.

The difference shows in one place: heavy editing of smooth gradients. Push a sky hard in an 8-bit file and it can band into visible steps, where a 16-bit original would not. The format does support 16 bits per channel, but support for reading it is patchy enough that it is rarely the right choice for a file being shared.

Interlacing costs more than it gives

PNG offers Adam7 interlacing, which loads the image as a coarse mosaic that refines in seven passes rather than arriving top to bottom. It was designed for slow connections in the 1990s.

It makes files noticeably larger — often 20 per cent or more — and the benefit on any modern connection is imperceptible. Leaving it off is the right default, and most tools do, but exports from older software occasionally still enable it and that is worth checking when a PNG is inexplicably heavy.

Optimisers find a great deal

PNG allows several filtering strategies per row and several compression settings, and most software picks quickly rather than well. Tools that try harder — running every filter combination and choosing the best — routinely reduce a file by 20 to 50 per cent with the pixels unchanged.

A separate class of tool reduces the palette to a chosen number of colours, which is genuinely lossy despite producing a PNG. For screenshots and flat graphics the visual difference is often invisible and the saving large, but it should be a deliberate choice rather than something a tool did quietly.

Animation is not really its job

APNG exists and is supported by every current browser, extending PNG with animation frames while remaining backwards compatible — an old viewer shows the first frame rather than failing. It is genuinely better than GIF: full colour and proper transparency.

It has never displaced GIF culturally, and for anything longer than a couple of seconds a video file is dramatically smaller than either. APNG is worth reaching for when an animation needs soft transparent edges and must remain an image rather than a video.

When something else is the better answer

JPEG for photographs that are finished and only need to be looked at — dramatically smaller, and the loss is invisible at a good quality setting. WebP for a web page, where it does both jobs and is 20 to 30 per cent smaller than PNG on the same lossless content, with support now effectively universal.

PNG remains right for screenshots, diagrams, logos, icons, anything with transparency, and anything that will be edited again. That is a large share of the images on a computer, which is why the format has outlived every attempt to replace it.

The facts, in one place

Identifiers and provenance for the PNG format.
Extension.png
Media typeimage/png
Published byPNG Development Group
First published1996
SpecificationISO/IEC 15948

Where these figures come from

The claims on this page are checkable, and these are the documents that settle them.