A working example, with the files

Read PNG tEXt, zTXt and iTXt prompt records

PNG supports several ways to store text. A reader should identify the record and decode its payload before interpreting it. These examples store the same parameters in three different chunk encodings.

Follow the steps

  1. Download the tEXt, zTXt and iTXt samples below.
  2. Run each through the saved-prompt extractor. The positive prompt and settings should match across all three.
  3. Compare the file hashes: encoding the record differently can change the file bytes without changing the displayed picture or saved values.

Three encodings, one expected result

Our tEXt sample holds plain text. The zTXt and iTXt samples in this lab contain compressed payloads. The W3C specification defines these chunk formats; the downloadable files and results show exactly which cases our reader executed.

Every sample should return seed 42, 20 steps and the same paper-boat prompt. This demonstrates these three controlled cases, not arbitrary PNG compatibility.

A text record is data

The reader recognizes specific saved-record keys, such as parameters. It does not treat every PNG comment or description as an original generation prompt.

Records are editable. A matching prompt across files is a statement about the stored text, not a signature by an image generator.

When decoding fails

Damaged checksums, conflicting duplicate keys and oversized metadata are not accepted as one reliable saved instruction. The missing-prompt guide includes a conflict example. Keep the actual file if you need to investigate an unsupported case.

Download · Run · Compare

Try the verified example

We drew the picture by code and attached controlled records. The saved prompts and model names are demonstration data. These files test record reading; no image generator, screenshot app or social network was used to create these test results.

Observed output
[
  {
    "chunk_type": "tEXt",
    "saved_prompt": "Controlled example: a paper boat on a blue table",
    "seed": "42",
    "steps": 20,
    "cfg_scale": 7
  },
  {
    "chunk_type": "zTXt",
    "saved_prompt": "Controlled example: a paper boat on a blue table",
    "seed": "42",
    "steps": 20,
    "cfg_scale": 7
  },
  {
    "chunk_type": "iTXt",
    "saved_prompt": "Controlled example: a paper boat on a blue table",
    "seed": "42",
    "steps": 20,
    "cfg_scale": 7
  }
]

Seed values in the JSON are strings so that large integers retain their precision. A null result here means no supported saved prompt was returned.

Hashes and reproduction
  • parameters-tEXt.png · 13,371 bytese76d2af4e6c273e1ba8ca6cf2b5b7885ceda2321bce893f0bb5f9e64ace17c9f
  • parameters-zTXt.png · 13,346 bytes2cbac7bbc872ec95d8979132ef871b3a1f816ffc55bc12e68ea10ab5ac2d7818
  • parameters-iTXt.png · 13,349 bytes4123149f352daeb842ecf241f7c7e6ee0fc4c5a08175ecb37fc690e093484cbf

Fixtures and observations are CC0-1.0. Download all observations and versions or read the procedure. The complete Node.js reproduction script (requires sharp) creates the same test inputs and compares bytes and pixels. The isGenAI source checkout additionally verifies saved fields with npx tsx scripts/build-guide-lab.ts.

For the separate export study, explore the 18 metadata-retention cases.

Sources and method

The linked primary sources describe the formats. The downloadable fixture outputs were checked with automated assertions against the current isGenAI reader. These guides were prepared with AI assistance and reviewed against those examples.

Report an error or unsupported example. For a signed record, inspect Content Credentials.