Overview
PNG is a lossless raster image format designed as a patent-free replacement for GIF. Developed by an internet community working group and standardized as a W3C Recommendation and ISO/IEC 15948, PNG preserves every pixel exactly as authored — no compression artifacts, no quality degradation on repeated saves. This makes it the preferred format for images that demand precision: screenshots, diagrams, UI elements, logos with text, and any graphic where sharp edges and flat color areas must remain crisp.
PNG's standout feature is its support for an alpha channel, enabling per-pixel transparency with 256 levels of opacity. This capability is essential for web design and application development, where images must composite seamlessly over varying backgrounds. Unlike GIF's binary transparency (a pixel is either fully transparent or fully opaque), PNG's alpha channel allows smooth anti-aliased edges, drop shadows, and glass-like translucent effects.
The format uses the DEFLATE compression algorithm (the same algorithm used in ZIP and gzip) applied to filtered scanlines, achieving excellent compression for images with large areas of uniform color, repeated patterns, or smooth gradients. For photographic content with complex textures, however, PNG files are substantially larger than their JPEG equivalents because lossless compression cannot discard visual information.
History
PNG emerged in January 1995 as a direct response to the GIF patent controversy. Unisys, which held the patent on the LZW compression algorithm used in GIF, began enforcing licensing fees against software developers, provoking outrage in the internet community. Thomas Boutell and an informal working group quickly drafted a specification for a new format that would be entirely free of patent encumbrances.
The first PNG specification (version 1.0) was published as a W3C Recommendation on October 1, 1996. An updated version (1.2) followed in 1999, and ISO standardized it as ISO/IEC 15948 in 2003. The related MNG (Multiple-image Network Graphics) format for animations never gained traction, but APNG (Animated PNG), an unofficial extension by Mozilla, achieved broad browser support by 2020 and is now supported in all major browsers.
Technical Details
A PNG file begins with an 8-byte signature (137 80 78 71 13 10 26 10) followed by a sequence of chunks. Each chunk has a 4-byte length, a 4-byte type code, the data payload, and a 4-byte CRC32 checksum. The critical chunks are IHDR (image header specifying dimensions, bit depth, and color type), IDAT (compressed image data), and IEND (image trailer). Optional ancillary chunks include tEXt (text metadata), gAMA (gamma correction), cHRM (chromaticity), iCCP (embedded ICC color profile), and tRNS (transparency for palette-based images).
PNG supports five color types: grayscale (1/2/4/8/16-bit), RGB (8/16-bit per channel), palette-based (1/2/4/8-bit indices into a 256-color table), grayscale with alpha, and RGBA. Before compression, each scanline is passed through one of five filter types (None, Sub, Up, Average, Paeth) to improve compressibility by exploiting pixel-to-pixel correlation. The filtered data is then DEFLATE-compressed. Interlacing via the Adam7 scheme allows progressive display, rendering a low-resolution preview in seven passes.
Pros & Cons
Pros
- Lossless compression preserves every pixel without artifacts or quality loss
- Full alpha channel transparency with 256 opacity levels per pixel
- Patent-free, royalty-free open standard (W3C Recommendation, ISO/IEC 15948)
- Excellent for screenshots, diagrams, logos, and graphics with sharp edges
- Supports 16-bit per channel color depth for high dynamic range workflows
Cons
- File sizes are much larger than JPEG for photographic content
- No native animation support in the base specification (APNG is an extension)
- Not suitable for print workflows that require CMYK color space
- Compression speed is slower than simpler formats like BMP
- Lossless compression cannot match the file size reduction of lossy formats for photos
Common Use Cases
- Capturing and sharing screenshots with pixel-perfect text and UI elements
- Creating web graphics, icons, and buttons that need transparent backgrounds
- Storing sprites and texture assets in game development pipelines
- Preserving scanned line art, maps, and technical diagrams without artifacts
- Exporting design mockups from tools like Figma, Sketch, and Adobe XD
- Displaying data visualizations and charts on websites with crisp rendering