The W3C recently published the Portable Network Graphics (PNG) Specification (Third Edition), two decades after the second edition was accepted as a web standard. This update introduces High Dynamic Range (HDR) color, standardizes Animated PNGs (APNGs), and adds Exif metadata support, making PNG a valuable alternative to other formats like AVIF and WebP.
The PNG format was last updated in 2003. The motivation for crafting the third edition came from the W3C’s Timed Text Working Group, which required a format capable of supporting HDR in subtitles. The sometimes excessive subtitles’ brightness, specially against dark scenes, can cause eye strain and distract from the surrounding content. This need catalyzed a broader effort involving industry participants such as Adobe, Apple, and Google. The update was also driven by PNG’s role in digital preservation; it is a recommended format for the US Library of Congress due to its lossless compression and standardized nature.
The most significant change is the introduction of robust HDR support via a new 4-byte cICP
chunk (Coding-Independent Code Points). This chunk allows an image to explicitly define its color space, transfer function, and matrix coefficients. Chris Lilley, one of the original developers of PNG who contributed to the formulation of the new PNG specification, explained in a technical article how this enables accurate color rendering on the commonly available wide-gamut displays.
In addition, the new specification formally standardizes Animated PNGs (APNGs). Previously an unofficial extension proposed by Mozilla, APNGs provide a lossless, frame-by-frame animation capability with support for 24-bit color and 8-bit alpha transparency. Developers now have an improved alternative to animated GIFs.
Lastly, the spec adds official support for Exif data, allowing metadata such as copyright information and camera settings to be embedded directly within the file.
Developer discussions on Reddit highlighted the practical advantages of a standardized APNG format. While modern video codecs are generally more efficient for animations, they have some limitations. A Reddit user emphasized the importance of APNGs for animations requiring transparency:
While the webm spec supports an alpha channel, Safari does not render it. So if you want animated assets with transparent backgrounds, but feel limited by gif’s 1-bit alpha depth, APNG would be a good choice. I suspect that this is why apple’s short-lived iMessage “stickers” supported APNG.
Source: pdschatz on Reddit
While the new features are designed to be backward compatible, one HackerNews user noted that it could be further improved:
This is great but also has the issue that users might not notice that their setup is giving them a less than optimal result… Seems the backwards compatibility isn’t as great as it could be. Old programs show a washed out image instead which sucks. This should have been avoidable in the same way JPG gain maps work so that you only need updated programs to take advantage of the increased gamut… and not to correctly show colors that fit into sRGB.
Source: account42 on Hacker News
The article’s author confirmed that the working group is aware of this and plans to address it in the next edition of the specifications. “PNG Fourth Edition, which we are working on now, is likely to add gain maps,” they wrote. “However, gain maps are extra data. So there is a trade off.”
A Fifth Edition of the specifications will research compression improvements, with goals including updating libpng, enabling parallel encoding/decoding, and potentially integrating modern algorithms like zstd.