PNG holds text in three chunks: tEXt (uncompressed Latin-1), zTXt (compressed
Latin-1) and iTXt (UTF-8, compressed or not, with a language). Any number may appear, and in any
position, though a file does well to put short ones before the image data and long ones after.
Keywords
Every text chunk begins with a keyword saying what the text is. A keyword is 1 to 79 bytes of printable Latin-1 (codes 32 to 126 and 161 to 255), case-sensitive, with no leading, trailing or consecutive spaces, and ends with a null byte. The same keyword may appear in more than one chunk.
| Keyword | Meaning |
|---|---|
| Title | A short one-line title or caption. |
| Author | The name of the image’s creator. |
| Description | A description of the image, possibly long. |
| Copyright | A copyright notice. |
| Creation Time | When the image was originally created (RFC 3339 is preferred, RFC 1123 allowed). |
| Software | The software that created the image. |
| Disclaimer | A legal disclaimer. |
| Warning | A warning about the nature of the content. |
| Source | The device used to create the image. |
| Comment | Miscellaneous comment. |
| XML:com.adobe.xmp | XMP metadata; recommended as an uncompressed iTXt with an empty language tag and translated keyword. |
| Collection | The name of a collection the image belongs to, one chunk per collection. |
Other keywords may be defined privately; they should be self-explanatory and unlikely to collide with someone else’s.
tEXt
| Field | Size | Meaning |
|---|---|---|
| Keyword | 1 to 79 bytes | See above. |
| Null separator | 1 | |
| Text | The rest | Latin-1 text with no null byte and no terminating null; line feeds end lines. Characters outside Latin-1 need iTXt. |
zTXt
| Field | Size | Meaning |
|---|---|---|
| Keyword | 1 to 79 bytes | Not compressed. |
| Null separator | 1 | |
| Compression method | 1 | 0, zlib Deflate, is the only value. |
| Compressed text | The rest | A zlib stream that inflates to the same Latin-1 text a tEXt would hold. |
iTXt
| Field | Size | Meaning |
|---|---|---|
| Keyword | 1 to 79 bytes | See above. |
| Null separator | 1 | |
| Compression flag | 1 | 0 not compressed, 1 compressed. |
| Compression method | 1 | 0 when compressed; set to 0 and ignored otherwise. |
| Language tag | 0 or more | A BCP 47 tag such as en-GB, case-insensitive; empty means unspecified. |
| Null separator | 1 | |
| Translated keyword | 0 or more | The keyword in the tagged language, in UTF-8. |
| Null separator | 1 | |
| Text | The rest | UTF-8 text, zlib-compressed when the flag is 1, with no null byte. |
Only the text field may be compressed. Line feeds end lines, and other control characters are discouraged.
In the explorer
The Text table shows every keyword with its meaning, the text decompressed and decoded, and the chunk it came from. Each compressed text chunk also appears in the Compression table, with a Show button for its Deflate stream.