Open 16-bit grayscale PNGs as I;16 by radarhere · Pull Request #7849 · python-pillow/Pillow
Resolves #3796
#3041 originally asked why PNGs were opened in I mode rather than I;16, and the response was
There's better support for image operations on int32 images than int16, especially for signed 16 bit images.
Nevertheless, #3796 was opened, and has received various comments.
The one I find compelling is #3041 (comment)
Pillow's TIFF and JPEG handlers, for example, will happily open 16-bit data without upcasting, so I don't see why the PNG handler can't do the same.
Looking through our test images, it is true that 12bit.cropped.tif is opened as I;16, 16bit.MM.cropped.tif is I;16B and 16bit.cropped.j2k is I;16. So some consistency would be good.
This PR changes PNG to open as I;16 rather than I.