Nepedia
Back to Discover
Advanced Reader
💻

PNG

technology Maturity 11-13 Next article →

Portable Network Graphics, or PNG, is a raster-graphics file format designed for the internet.

Comparison of JPEG and PNG
Comparison of JPEG and PNG

It is a vital tool for digital imaging because it supports lossless data compression. Lossless compression means the file size is reduced without losing any original image detail. This ensures that the image remains perfect every time it is opened. PNG was specifically built to be a free, non-patented replacement for the Graphics Interchange Format (GIF). Unlike professional print formats, PNG does not support CMYK color spaces. Instead, it focuses on RGB and RGBA color models, which are ideal for web use.

PNG transparency demonstration 1
PNG transparency demonstration 1

The structure of a PNG file is built from an extensible series of parts called chunks. A PNG file begins with an eight-byte signature to identify the format. This signature includes specific values like 89 to detect certain transmission systems and the ASCII letters 'PNG' for easy identification. Following this header, the file contains various chunks that carry specific information. Each chunk consists of four parts: a length, a chunk type name, the actual chunk data, and a cyclic redundancy code (CRC). The CRC is a checksum used to ensure the data has not been corrupted.

Pixel-prediction
Pixel-prediction

Chunks are categorized as either critical or ancillary. Critical chunks are essential for the computer to read and render the image. If a program does not recognize a critical chunk, it must stop reading the file or warn the user. For example, the IHDR chunk must always be the first critical chunk. It contains the image's width, height, bit depth, and color type. The IDAT chunk is also critical because it holds the actual image data. Other critical chunks include PLTE, which holds a color palette, and IEND, which marks the very end of the image.

PNG-Gradient
PNG-Gradient

Ancillary chunks are optional parts that provide extra information. A computer can safely ignore these if it does not understand them. This design allows the PNG format to be extended with new features while staying compatible with older software. These extra chunks can store many types of metadata. For instance, the bKGD chunk defines a default background color. The gAMA chunk stores gamma values for color correction. Other chunks like tEXt or iTXt can store textual comments and descriptions. Some chunks, such as pHYs, can even hold information about the intended pixel size.

The history of PNG began with a legal dispute in late 1994. At that time, it was announced that using the GIF format would require paying royalties to Unisys. This was due to a patent on the Lempel–Ziv–Welch (LZW) compression algorithm. This news caused a massive outcry among computer users. On January 4, 1995, Thomas Boutell started a discussion on the Usenet group "comp.graphics" to plan a free alternative. Other experts joined the effort, eventually forming the PNG Development Group. Oliver Fromme suggested the name PING, which evolved into the recursive acronym PNG, meaning "PING Is Not GIF."

PNG-Gradient hex
PNG-Gradient hex

Since its inception, the PNG specification has undergone many revisions and standardizations. The full specification was approved by the World Wide Web Consortium (W3C) on October 1, 1996. It was published as RFC 2083 in March 1997. In 2004, it became an official International Standard known as ISO/IEC 15948. The format has continued to evolve through various versions. Version 1.1 was released in 1998 to fix color correction issues. Version 1.2 arrived in 1999 to add the iTXt chunk. Most recently, a new draft for a third edition was published in October 2022 to support high dynamic range (HDR) and Exif data.

While the standard PNG format is meant for single images, there have been efforts to add animation. In 2001, developers released the MNG format, but it did not gain much popularity. Later, in 2008, Mozilla developers introduced the Animated Portable Network Graphics (APNG) format.

Animated PNG example bouncing beach ball
Animated PNG example bouncing beach ball

APNG is now widely supported by major web browsers like Chrome and Edge. It is also used for thumbnails on systems like the Sony PlayStation Portable. Because APNG uses the same file structure as PNG, it demonstrates how the original chunk-based design allows for powerful new uses in the digital world.

687 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ Images & Media (8)
File:PNG transparency demonstration 1.png
PNG transparency demonstration 1.png
File:PNG-Gradient hex.png
PNG-Gradient hex.png
File:Pixel-prediction.svg
Pixel-prediction.svg
File:PNG-Gradient.png
PNG-Gradient.png
File:Adam7 passes.gif
Adam7 passes.gif
File:Animated PNG example bouncing beach ball.png
Animated PNG example bouncing beach ball.png
File:Comparison of JPEG and PNG.png
Comparison of JPEG and PNG.png
File:PNGOUT plugin.png
PNGOUT plugin.png
More to explore

🔬 Go deeper

More advanced topics to explore

🪜 Step back

Simpler topics to build understanding

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.