doom

PNG (for Portable Network Graphics) is a graphic file format that is supported by various source ports, notably Doom64 EX, Doomsday, EDGE, Vavoom, ZDoom and ZDoom-derivatives. Most support this format for textures, some also support it for sprites, and ZDoom even uses it as the container for its savegame format.

Special chunks

PNG chunks can be likened to WAD lumps, they are a specific subpart of the file. Contrarily to lumps, they are case-sensitive: The first letter is upper-case for "critical" chunks (without which the image cannot work) and lower-case for "ancillary" chunks (which can be ignored). The second letter is upper case for public chunks (part of the standard specifications) or lower case for "private" chunks (non-standard). The third letter has no given role yet and is thus always upper case, and the last letter indicates whether image manipulation software that does not recognize the chunk should delete it (upper-case) or keep it (lower-case). A chunk's anatomy consists of a 32-bit unsigned integer value for its data size, then the four-byte chunk name, and finally a 32-bit integer value used for cyclic redundancy check performed on the data and name bytes. The minimum size of a chunk is therefore 12 bytes for a data-less chunk; however only the data bytes are counted for the size value.

The PNG format encourages the use of custom, non-standard chunks for specialized roles. The following custom chunks have special relevance for various source ports.

Notes

Doom64 EX uses 8-bit paletted PNG, but does not use a tRNs chunk to indicate transparency. Instead, the first palette index is assumed to be fully transparent if black. Since the color for this index is also used by other indices, adding transparency to images extracted from the IWAD generated by WadGen should not be done only on a color basis but also on an index basis.

Sources

This article incorporates text from the open-content ZDoom documentation project article PNG.