Chunks defined outside the main specification, in the register of public PNG chunks. Most are rarely seen. The scientific ones describe what the samples mean; the GIF ones keep data from a converted GIF.
oFFs, image offset
Where the image sits on a page. Once, before the image data.
| Offset | Size | Field | Meaning |
|---|---|---|---|
| 0 | 4 | X position | Signed. |
| 4 | 4 | Y position | Signed. |
| 8 | 1 | Unit | 0 pixels, 1 micrometres. |
pCAL, calibration of pixel values
How sample values map to a physical quantity, for scientific images. Once, before the image data.
| Field | Size | Meaning |
|---|---|---|
| Calibration name | 1 to 79 bytes | The same rules as a keyword. |
| Null separator | 1 | |
| Original zero (x0) | 4 | Signed. |
| Original maximum (x1) | 4 | Signed; it must differ from x0. |
| Equation type | 1 | See below. |
| Number of parameters | 1 | Must match the equation type. |
| Unit name | 0 or more bytes | Printable Latin-1 with spaces allowed; empty for a dimensionless value. |
| Null separator | 1 | |
| Parameters | The rest | p0, p1 and so on, as ASCII floating-point strings separated by nulls, with no null after the last. |
A stored sample first becomes an original value o by linear mapping:
o = (stored × (x1 − x0) + max ÷ 2) ÷ max + x0
with max = 2depth − 1 and integer division rounding towards negative infinity. The physical value then follows from the equation type:
| Type | Equation | Parameters |
|---|---|---|
| 0 | p0 + p1 × o ÷ (x1 − x0) (linear) | 2 |
| 1 | p0 + p1 × exp(p2 × o ÷ (x1 − x0)) (exponential, base e) | 3 |
| 2 | p0 + p1 × p2 ^ (o ÷ (x1 − x0)) (exponential, any base) | 3 |
| 3 | p0 + p1 × sinh(p2 × (o − p3) ÷ (x1 − x0)) (hyperbolic sine) | 4 |
An ASCII floating-point string has an optional sign, an integer part or a fraction (or both), and an optional exponent starting
with E or e. Nothing else is allowed in it.
sCAL, physical scale
The real size a pixel covers, for maps and scientific images. Once, before the image data.
| Field | Size | Meaning |
|---|---|---|
| Unit | 1 | 1 metres, 2 radians. |
| Pixel width | 1 or more bytes | An ASCII floating-point string, greater than zero. |
| Null separator | 1 | |
| Pixel height | 1 or more bytes | An ASCII floating-point string, greater than zero, with no null after it. |
sTER, stereo image
The image is two pictures side by side. Once, before the image data. One byte: 0 cross-fuse (the right eye’s picture on the left), 1 diverging-fuse (the left eye’s picture on the left).
The two pictures are the same size, and the right one starts on a column divisible by eight, so the image holds padding between them. From the width W, a reader finds the padding and each picture’s width:
padding = 15 − ((W − 1) mod 16)
sub_width = (W − padding) ÷ 2
A padding greater than 7 means the width cannot be split this way, which is an error.
gIFg, GIF graphic control
A GIF’s graphic control extension, kept when a GIF was converted. It has no effect on the PNG, and does not make it animated. It may appear more than once.
| Offset | Size | Field | Meaning |
|---|---|---|---|
| 0 | 1 | Disposal method | As in GIF: 0 not specified, 1 do not dispose, 2 restore to background, 3 restore to previous. |
| 1 | 1 | User input flag | Whether user input was expected before continuing. |
| 2 | 2 | Delay time | In hundredths of a second. |
gIFx, GIF application extension
A GIF application extension, kept when a GIF was converted. It may appear more than once.
| Offset | Size | Field | Meaning |
|---|---|---|---|
| 0 | 8 | Application identifier | Printable ASCII. |
| 8 | 3 | Authentication code | |
| 11 | The rest | Application data | Copied unchanged, with GIF’s sub-blocks removed. |
gIFt, GIF plain text extension (deprecated)
A GIF’s plain text extension, kept when a GIF was converted. The register discourages encoders from writing it and readers need not support it. It may appear more than once.
| Offset | Size | Field |
|---|---|---|
| 0 | 4 | Text grid left position |
| 4 | 4 | Text grid top position |
| 8 | 4 | Text grid width |
| 12 | 4 | Text grid height |
| 16 | 1 | Character cell width |
| 17 | 1 | Character cell height |
| 18 | 3 | Text foreground colour (red, green, blue) |
| 21 | 3 | Text background colour (red, green, blue) |
| 24 | The rest | Plain text data, one continuous run |
A converter also replaces GIF’s palette indexes in the colours with the RGB values they stood for.
dSIG, digital signature
Guarantees the file has not changed since it was signed. dSIG chunks come in pairs, one introductory and one terminating. Its definition is in a separate document, the PNG Digital Signatures specification (version 1.0, 2008).
Each chunk’s data is a CMS SignedData structure (RFC 3852), written as DER in its external-signature form, with the content type id-data and no encapsulated content:
| Field of SignedData | Introductory chunk | Terminating chunk |
|---|---|---|
| version | 1 | 1 |
| digestAlgorithms | The digest algorithm, such as SHA-1 | Empty |
| encapContentInfo | id-data, no content | id-data, no content |
| certificates | Absent | The signer’s certificate and any others needed for the chain |
| signerInfos | Empty | One signer: issuer and serial, digest algorithm, signature algorithm, signature, and optional attributes such as a signing time or a comment |
The chunk’s length must equal the length of the structure, so nothing else can be hidden inside it. The signature is computed over the IHDR chunk, everything between the two dSIG chunks of the pair (nested pairs included), and the IEND chunk, in full, and not over the file’s 8-byte signature or the pair’s own two chunks.
The outermost introductory chunk comes directly after IHDR and the outermost terminating chunk directly before IEND. A file may be signed again by nesting a pair inside the first, the new chunks directly inside the old with nothing between. Two further object identifiers are defined for signed and unsigned comments, 1.3.6.1.4.1.31170.1.1.1 and 1.3.6.1.4.1.31170.1.2.1, each a PrintableString.
The explorer reads and names every field of the CMS structure, and checks the pairing and the content type, but it does not check the signature itself.
fRAc, fractal image parameters
Registered for the parameters used to generate a fractal image, with its contents to be defined by Tim Wegner. The layout was never published, so the register gives no fields, and the explorer can only show the data as bytes.
Other chunks you may meet
Apple’s CgBI and iDOT, Android’s npTc and the private chunks of
ImageMagick and Adobe Fireworks are private additions, not part of the register. The explorer names them, and
Apple’s CgBI pictures are decoded.