FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Open 16-bit grayscale PNGs as I;16 by radarhere · Pull Request #7849 · python-pillow/Pillow · GitHub

Open 16-bit grayscale PNGs as I;16 - #7849

Merged
hugovk merged 1 commit into
python-pillow:mainfrom
radarhere:png_i16
Mar 2, 2024
Merged

Open 16-bit grayscale PNGs as I;16#7849
hugovk merged 1 commit into
python-pillow:mainfrom
radarhere:png_i16

Conversation

Copy link
Copy Markdown
Member

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.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PNG opens as I rather than I;16

2 participants


Back | FazBrowse Home | New Git URL