Format Basics

What Is PNG? The Lossless Image Format With Transparency, Explained

A logo on a website, an icon in an app, a screenshot in a chat, a sticker with a see-through background — almost certainly that's a PNG. It's the format that loses not a single pixel when it compresses and can make a background truly transparent. Let's unpack how it works, how PNG-8, PNG-24 and PNG-32 differ, and when PNG is the right choice — and when it isn't.

A designer working on bright graphics at a laptop — logos and icons are most often saved as PNG
Logos, icons and graphics with transparency are PNG's natural habitat. Photo: Pexels

What PNG is in plain English

PNG (Portable Network Graphics) is a raster image format — a picture made of pixels, like a photograph. But unlike the familiar JPG, PNG has two superpowers: it compresses without losing any quality and it can store transparency. That's why logos, icons, screenshots, UI buttons and any image where crisp edges and text matter all live as PNG.

The key difference from JPG is easiest to see with an example. Save a logo as JPG and faint, muddy fringes appear along the sharp edges of the letters, while the transparent background turns white. Save the same logo as PNG and the edges stay razor-sharp and the background can be made invisible. PNG keeps every pixel exactly as it was.

In short

PNG is a raster format with lossless compression and transparency. It's ideal for drawn graphics: logos, icons, screenshots and text. For photographs, JPG or WebP are usually better — they produce a file many times smaller.

Where PNG came from: a format born from a patent row

PNG has a surprisingly dramatic backstory. In late 1994, Unisys suddenly announced that the LZW compression algorithm at the heart of the wildly popular GIF format was covered by its patent — and using it would now require royalties. To a whole generation of web developers, this came like a bolt from the blue.

The response was immediate. As early as January 4, 1995, programmer Thomas Boutell kicked off a discussion of a free GIF replacement in the Usenet group comp.graphics. An informal internet working group of enthusiasts formed and got to work. Instead of patented LZW, they adopted the open DEFLATE algorithm — and won straight away: tests showed that simply swapping LZW for DEFLATE compressed about 10% better.

In October 1996, version 1.0 of the specification was released and, at the same moment, became a W3C recommendation. The result was a completely free format that not only replaced GIF but outclassed it: it added full color (24-bit, versus GIF's measly 256 colors) and genuine smooth transparency.

PNG is a rare case of a format born not in a corporation but in the open correspondence of enthusiasts annoyed by a patent — and it beat the original on every count.
Graphic-design posters with flat bright colors and shapes — exactly the kind of art PNG compresses well
Flat fills, sharp shapes and large areas of a single color are exactly where PNG compresses especially well. Photo: Pexels

Lossless compression: where the magic is

"Lossless compression" sounds like marketing, but the meaning is literal: after a PNG is decompressed you get exactly the same pixels you started with — every single bit. You can open, edit and re-save an image a hundred times in a row and it won't crumble the way a JPG does. How does PNG pull this off? In two steps.

Step 1 — filtering. Before compressing, PNG doesn't store the pixel colors directly; it predicts each pixel from its neighbors (to the left and above) and records only the difference. In an image with a smooth gradient or a flat fill, neighboring pixels are nearly identical, so the difference is close to zero — and long runs of zeros compress beautifully. PNG has five prediction methods to choose from: None, Sub, Up, Average and the clever Paeth, and it picks the best one for each row.

Step 2 — DEFLATE compression. The prepared data is squeezed with DEFLATE — the very same algorithm that powers ZIP archives. Thanks to the filtering, it finds far more repetition than it would in the raw pixels. The result: for the same content, a PNG is typically 10–50% smaller than a GIF, especially for screenshots, logos and simple graphics.

Why photos are heavy as PNG

The very logic that makes PNG a champion on graphics works against photographs. In a photo, neighboring pixels are almost always slightly different (noise, texture, gentle gradients), so prediction works poorly and there's little to compress. That's why a photograph as PNG can weigh 5–10 times more than the same image as JPG, with no visible benefit.

Transparency and the alpha channel

PNG's second superpower is true transparency. GIF's version was crude: a pixel could be either fully visible or fully invisible — no in-between. As a result, the edges of transparent images looked like a jagged staircase.

PNG solves this with an alpha channel. To the usual three color channels (red, green, blue) it adds a fourth — alpha — which stores, for each pixel, how transparent it is: a value from 0 (the pixel is fully transparent) to 255 (fully opaque). And because every value in between is allowed, you get soft shadows, glows, blurred edges and semi-transparent gradients that sit cleanly on any background.

A fan of color swatches held in hand — PNG stores the exact color of each pixel plus its transparency
Each pixel in a PNG-32 is four numbers: red, green, blue and alpha (transparency). Photo: Pexels

PNG-8, PNG-24 and PNG-32: the difference

"PNG" isn't one format but a family. The number in the name is the bits per pixel, and it governs the color palette, transparency support and file size all at once.

TypeColorsTransparencyWhen to use
PNG-8Palette up to 256On/off per pixelSimple icons, small graphics — minimum weight
PNG-2416.7M (truecolor)NoneFull-color graphics without a transparent background
PNG-3216.7M + alphaSmooth, per pixelLogos and images with soft transparency

PNG-8 stores not the colors themselves but indices into a palette of at most 256 shades — like paint-by-numbers. That makes it very light, but the palette isn't enough for photos and complex gradients. PNG-24 is full color: 8 bits for each of the three channels, 16.7 million colors in total, but with no alpha channel. PNG-32 is that same truecolor plus an 8-bit alpha, i.e. full smooth transparency. It's what people mean when they say "a PNG with a transparent background."

Don't confuse "lossless" with "small"

PNG loses no quality, but that doesn't make it lightweight. A large PNG-32 can be very heavy because of the alpha channel. If you don't need transparency, choose PNG-24 or PNG-8 and the file will be noticeably lighter. And for the web, transparent graphics are often converted to WebP: it supports an alpha channel too, but weighs less.

How a PNG file looks inside

Peek under the hood of a PNG file and you'll find a tidy, almost engineered design. Every PNG begins with an 8-byte signature (137 80 78 71 13 10 26 10). It's the format's fingerprint: from it, a program instantly knows this really is a PNG and not something else.

After that comes a chain of blocks called chunks. Each chunk is a small, self-contained packet of four parts: the data length, a four-letter type (such as IHDR), the data itself, and a CRC checksum to verify integrity. Three chunks are mandatory in any PNG:

  • IHDR — always first. It's the picture's "passport": width, height, color depth, type (palette / truecolor / grayscale) and whether there's an alpha channel.
  • IDAT — this holds the compressed pixels themselves. There can be several of these in a row.
  • IEND — the simplest chunk of all: empty, it just says "the file ends here."

Between them can sit optional (ancillary) chunks: tRNS for palette transparency, gAMA for gamma, tEXt for text notes and others. The neat part: a program that doesn't recognize a chunk simply skips it — the format is extensible by design.

Full name
Portable Network Graphics
Extension
.png
Compression
Lossless (DEFLATE)
Transparency
Yes (alpha channel)
Color depth
Up to 16 bits per channel
Animation
No (APNG extension exists)
1996version 1.0 released
256levels of transparency (alpha)
0%quality lost in compression

When to choose PNG — and when not to

PNG isn't the "best format overall" — it's a specialist in its field. The simple rule: if the image has sharp edges, text, or needs transparency, reach for PNG. If it's an ordinary photograph, JPG is almost always the better deal.

Logos and icons

Crisp lines and flat colors stay sharp, and the background stays transparent.

Screenshots and text

No artifacts around the letters — text reads perfectly.

Photographs

The file will be many times larger for the same look — use JPG or WebP.

Need to shrink a PNG for your site?

If a photo ended up as a PNG and weighs too much, convert it to JPG with the free FormatZ converter — right in your browser, with no install and no sign-up.

Convert PNG to JPG

How to open and convert PNG

Opening a PNG is never a problem: every browser understands it, as do the built-in viewers on Windows and macOS and every graphics editor — from Photoshop and GIMP to the free Paint.NET. Double-click and the image is on screen.

Converting, on the other hand, is often needed — usually to cut down the size. If your PNG turns out to be a photo, convert it to JPG and the size drops dramatically. Want the best of both — light yet transparent — pick WebP. Got an image in another format and want transparency or crispness back? The reverse conversions JPG → PNG or WebP → PNG come in handy. The full list of available conversions is on the all formats page.

A word on converting back

Remember: if a photo was already a JPG, converting it to PNG will not bring back the lost quality — it only "freezes" the image losslessly from here on. PNG preserves what's there; it can't restore what JPG already threw away.

It depends on the image. PNG compresses without loss and supports transparency, so it is ideal for logos, icons, screenshots and any graphic with sharp edges or text — they stay crisp. JPG is better for photos: it produces a far smaller file with barely visible quality loss. The rule of thumb: drawn graphics or transparency means PNG; a photo without transparency means JPG.
Lossless. PNG uses scanline filtering plus the DEFLATE algorithm (the same one inside ZIP): after decompression you get exactly the same pixels you started with, down to the last bit. You can save a PNG as many times as you like and the quality never degrades.
PNG-8 stores a palette of up to 256 colors — it is the lightest and suits simple icons. PNG-24 is a full-color image (16.7 million colors) but with no alpha channel. PNG-32 is the same full-color image plus an 8-bit alpha channel, meaning smooth per-pixel transparency. Transparent PNGs are almost always PNG-32.
PNG adds an alpha channel to each pixel's color — a separate transparency value from 0 (fully transparent) to 255 (fully opaque). That gives soft shadows, glows and anti-aliased edges. JPG simply has no such channel in its structure, so transparency is impossible for it.
PNG opens everywhere: any browser, the built-in viewers on Windows and macOS, and editors like Photoshop, GIMP and Paint.NET. To shrink it for the web, people usually convert PNG to JPG (for photos) or to WebP (general purpose) — for example with the FormatZ online converter, right in the browser with no install.