Why were PNG chunks named like that? -


i've studied png structure develop it. , found interesting.

the names of critical png chunks(ihdr, plte, idat, iend, plte) uppercase. , there @ least 1 lowercase character in names of ancillary png chunks(bkgd, chrm, gama, hist, iccp, itxt, phys, sbit, splt, srgb, ster, text, time, trns, ztxt, etc.).

i'm curious. there naming rule when standardize them?

according jongware, answer this: https://www.w3.org/tr/png/#5chunk-naming-conventions

5.4 chunk naming conventions

four bits of chunk type, property bits, namely bit 5 (value 32) of each byte, used convey chunk properties. choice means human can read off assigned properties according whether letter corresponding each byte of chunk type uppercase (bit 5 0) or lowercase (bit 5 1). however, decoders should test properties of unknown chunk type numerically testing specified bits; testing whether character uppercase or lowercase inefficient, , incorrect if locale-specific case definition used.

the property bits inherent part of chunk type, , hence fixed chunk type. thus, chnk , chnk unrelated chunk types, not same chunk different properties.

the semantics of property bits defined in table 5.2.

table 5.2 — semantics of property bits

ancillary bit: first byte

0 (uppercase) = critical, 1 (lowercase) = ancillary.

critical chunks necessary successful display of contents of datastream, example image header chunk(ihdr). decoder trying extract image, upon encountering unknown chunk type in ancillary bit 0, shall indicate user image contains information cannot safely interpret. ancillary chunks not strictly necessary in order meaningfully display contents of datastream, example time chunk(time). decoder encountering unknown chunk type in ancillary bit 1 can safely ignore chunk , proceed display image.

private bit: second byte

0 (uppercase) = public, 1 (lowercase) = private.

a public chunk 1 defined in international standard or registered in list of png special-purpose public chunk types maintained registration authority (see 4.9 extension , registration). applications can define private (unregistered) chunk types own purposes. names of private chunks have lowercase second letter, while public chunks assigned names uppercase second letters. decoders not need test private-chunk property bit, since has no functional significance; administrative convenience ensure public , private chunk names not conflict. see clause 14: editors , extensions , 12.10.2: use of private chunks.

reserved bit: third byte

0 (uppercase) in version of png. if reserved bit 1, datastream not conform version of png.

the significance of case of third letter of chunk name reserved possible future extension. in international standard, chunk names shall have uppercase third letters.

safe-to-copy bit: fourth byte

0 (uppercase) = unsafe copy, 1 (lowercase) = safe copy.

this property bit not of interest pure decoders, needed png editors. bit defines proper handling of unrecognized chunks in datastream being modified. rules png editors discussed further in 14.2: behaviour of png editors.


Comments