Comment by meindnoch
1 day ago
>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)
I suppose one could argue that if you are ignoring things like gamma and couour space and falling back on defaults, you are not showing the image correctly. My impression is that PNG takes a more relaxed approach, and considers anything that is in the right ballpark to be correct. For example, before hi-DPI screens ("retina display" and others) most image viewers would just map one image pixel to one display pixel, completely ignoring any "physical size" values, and this was generally considered correct.