3 ms·
Sweet no identification of color space, gamma, and forced storage of the alpha channel. What a great format! /s PNG is pretty stupid easy to parse and supports
by giantrobot 6y ago
Sweet no identification of color space, gamma, and forced storage of the alpha channel. What a great format! /s
PNG is pretty stupid easy to parse and supports inline compression and multiple bit depths. If you want some uncompressed format that's easy to pipe and parse just use the NetPBM family.
Images are not just 2D arrays of pixels. There's extra data needed to tell the viewing system some of the image's provenance so it does so correctly.
- randy408 6y agoWriting a naive PNG parser is easy, but handling all the corner cases is harder than it should be, e.g. text chunk fields can be variable- and even zero-length: 1. https://github.com/randy408/libspng/blob/3439bf5c173421b1af4d0f75c23325e99ac67318/spng/spng.c#L2083 https://github.com/randy408/libspng/blob/3439bf5c173421b1af4... 2. https://www.w3.org/TR/2003/REC-PNG-20031110/#11iTXt https://www.w3.org/TR/2003/REC-PNG-20031110/#11iTXt
- kayamon 6y agoColor space and gamma are clearly identified as sRGB.