libpng has a corner case with the last pixel of 16-bit grayscale images when they're decoded to 8-bit RGBA using gamma correction.
When basn0g16.png is decoded without gamma correction both pixels at 0,0 and 31,31 are decoded to RGBA 0 0 0 255. Using gamma correction it's 0 0 0 255 at 0,0 but it's 19 19 19 255 at 31,31.
The attached file reads basn0g16.png and decodes it without gamma correction and prints the first and last pixel's RGBA values. If "g" is passed as an argument it will decode using gamma correction.
This is reproducible with libpng 1.6.34
./gamma.o no gamma correction image size: 4096 first pixel: 0 0 0 255, last pixel: 0 0 0 255 ./gamma.o g doing gamma correction image size: 4096 first pixel: 0 0 0 255, last pixel: 19 19 19 255
This is also reproducible with 1.6.35.
Indeed. Will plan for 1.6.36.
Thanks for the follow-up.