Remix.run Logo
▲ akersten 2 hours ago

I clicked "Show metadata chunks" and I don't understand the Critical vs Ancillary distinction. The Gamma, Color Space Information, Physical Dimensions, and Background Color sections all have a lowercase letter for their header. Aren't those critical to displaying the image properly? Meanwhile the Trailer IEND has an uppercase letter, indicating the zero-length outro byte is somehow more essential than all the color info?

Same question for safe/unsafe to copy. "Do programs that modify the PNG data need to understand this chunk?" Somehow, they need to understand the Last Modification Date before modifying the image, but no, they don't need to understand the Physical Dimensions(?)

▲meindnoch 44 minutes ago | parent [-]

>Gamma, Color Space Information, Physical Dimensions, and Background Color

Gamma is assumed to be sRGB gamma by default. Default color space is likewise sRGB. The Background Color is supposed to be used as the background color, against which the image is alpha-composited by viewers. Most modern viewers ignore it, because the whole point of the alpha channel is that it an be shown over any color.

>Meanwhile the Trailer IEND has an uppercase letter, indicating the zero-length outro byte is somehow more essential than all the color info

The IEND chunk was made mandatory, to make the format self-delimiting. i.e. a PNG file truncated at a chunk boundary would look just like a complete file. (although, one could argue that you could find out it's truncated when the uncompressed data comes back smaller than widthheightbytes_per_pixel)