PNG file chunk inspector

submited by
Style Pass
2021-08-19 05:30:05

Portable Network Graphics is a ubiquitous file format for conveying still images. It is used on the web and in various document systems, and it has a decent level of lossless compression.

A PNG file is composed of an 8-byte signature header, followed by any number of chunks that contain control data / metadata / image data. Each chunk contains three standard fields – 4-byte length, 4-byte type code, 4-byte CRC – and various internal fields that depend on the chunk type.

The JavaScript tool on this page reads a given PNG file and dissects it deeply, showing the list of chunks and fields as well as any errors that violate the format specification. This can be helpful in looking for hidden metadata (i.e. stuff not in the visual picture), as well as in developing software that reads or writes PNG files in a compliant manner.

The PNG file format starts off with a magic signature, and is followed by any number of chunks all with a uniform syntax. This design is similar to other popular multimedia file formats, like: BMP, TIFF, WAV, AVI, general RIFF. It’s different from plain text file formats (examples like Netpbm surprisingly exist), XML’s hierarchical elements, a ZIP container of subfiles, PDF’s custom binary format, etc.

Leave a Comment