PNG Format Explained — Lossless Compression and Transparency
PNG explained: born from the GIF patent issue, W3C 1996 to the 2025 Third Edition (HDR, APNG, EXIF), lossless compression, chunks and transparency.
PNG (Portable Network Graphics) was created in the mid-1990s to avoid the patent issues surrounding the LZW compression used in GIF while offering better features than GIF. It became a W3C Recommendation in 1996 and was later standardized as ISO/IEC 15948. In June 2025, PNG Third Edition — the first revision in 22 years since the Second Edition (2003) — was published as a W3C Recommendation, officially adding animated PNG (APNG), HDR color information and the EXIF chunk to the standard.
How compression works
PNG is a lossless format that never changes pixel values. It applies a filter to each row to turn values into something easier to predict, such as "the difference from the pixel to the left or above", then compresses them with Deflate, the same family of algorithms as zip. Large areas of repeated color produce runs of zero differences and compress very well, while photos, where every pixel differs slightly, barely compress at all.
Reducing the image to 256 colors or fewer and saving it in palette mode (indexed color) can shrink the file dramatically, but this step itself is lossy because it reduces colors — so remember the result can differ from the original even though it's a PNG.
File signature and chunk structure
A PNG file always starts with an 8-byte signature (hex 89 50 4E 47 0D 0A 1A 0A). It is followed by units called chunks, each consisting of a length, a type (4 letters), data and a CRC checksum.
| Chunk | Role |
|---|---|
| IHDR | Width and height, bit depth, color type |
| PLTE | Palette (for indexed color) |
| tRNS | Transparency for palette and single-color images |
| IDAT | Compressed pixel data (can be split into several) |
| eXIf | EXIF metadata (officially included in the Third Edition) |
| cICP | Color space information such as HDR (added in the Third Edition) |
| acTL · fcTL · fdAT | APNG animation control and frames (officially included in the Third Edition) |
| IEND | End of file |
Because unknown ancillary chunks are designed to be ignored, older programs can still open files even when new features are added. That's also why viewers without APNG support show just the first frame.
Transparency
Each PNG pixel can have an alpha channel with 0–255 levels (0–65,535 at 16 bits), so semi-transparent shadows and hair edges look natural. This is why PNG is the standard format for cut-out images, logos and icons.
Strengths and limitations
- Ideal for text, lines and charts: Edges stay crisp, and files are often smaller than JPG.
- No loss on repeated saves: Good for intermediate editing files.
- Inefficient for photos: The same photo ends up several times larger than as a JPG.
- APNG support: According to Can I use, supported from Chrome 59, Firefox 3 and Safari 8; programs without support show only the first frame.
Main uses
Screenshots, logos and icons, images with transparent backgrounds, charts and graphs, and editing masters. Also used when a print shop requires lossless files.
Converting to other formats
- PNG → JPG: Transparent areas must be filled with a background color. Converting screenshots to JPG can blur the text, so keep quality high (PNG to JPG).
- PNG → WebP: Converting to lossless WebP often reduces size while keeping transparency. Google reports that lossless WebP is on average 26% smaller than PNG.
- PNG → ICO: If you need a favicon or Windows icon, convert PNG to ICO. A square original works best.
- 16-bit PNG: The browser Canvas works at 8 bits per channel, so converting a 16-bit original with a web tool reduces it to 8 bits.