-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable writing I;16B images as PNG #7301
Comments
I've created PR #7302 to resolve this. |
|
Yes, I always thought so as well. However, if you check the unpack function for Pillow/src/libImaging/Unpack.c Lines 1152 to 1160 in 3c5324b
So I am not sure if |
While investigating an ImageIO issue concerning behavior on big-endian architectures I've noticed that pillow's PNG plugin currently doesn't allow writing 16-bit big-endian images to PNG.
I;16
is already supported, so I was wondering if it would be possible to addI;16B
as well.From what I can see, the only change needed to support this would be to add the line
"I;16B": ("I;16B", b"\x10\x00"),
to this dict:Pillow/src/PIL/PngImagePlugin.py
Lines 1035 to 1051 in 3c5324b
With this change we would be able to do 16 bit round-trips on big-endian, i.e., we can decode the pixel data directly into a 16 bit big-endian buffer and then use that same buffer when encoding as PNG. This would improve performance and streamline working with native encoding on big-endian machines.
The text was updated successfully, but these errors were encountered: