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 Edit
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.
- grAb - indicates the center position of the image. This is used to indicate sprite offsets in ZDoom and Doom64 EX. This should not be confused with the standard oFFs chunk, which is meant for printing offsets. This chunk must be between the IHDR chunk and the first IDAT chunk. SLumpEd and SLADE 3 are both able to edit this chunk. The data for the chunk contain the X-offset, then the Y-offset, both represented by a 32-bit signed integer value each.
- alPh - indicates that a grayscale image should be treated as a standalone alpha channel. This data-less lump is used by ZDoom for decals. This chunk must be between the IHDR chunk and the first IDAT chunk.
- huBs, ptIc, snAp, viSt, pcLs and raNd - various chunks used by ZDoom and derivatives to store save game information. These chunks must be between the last IDAT chunk and the IEND chunk.
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.