-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
BGR;15/16 scaling #7970
Comments
These modes aren't actually used by any image format (the rawmodes are, but not the modes). So a discussion about how they should behave is just about consistency with how the rest of Pillow behaves. But speaking of the fact that they aren't used
If your goal is to progressively ensure that all Pillow operations are supported for all modes, I don't think building out support for them in a test-driven development fashion is a worthwhile endeavour if there's no evidence that they would be used. I'm more in favour of the idea from #2228 of just removing BGR;15, BGR;16 and BGR;24 as modes entirely. |
I agree with removing them, but I think that will require a deprecation period. Slightly changing how they work doesn't require a deprecation period, so it could be done at the same time. |
Also, the two converters changed in #7972 should be added as packers. There's not really any difference between a packer, an unpacker, and a converter, so they could all be grouped into one list. |
I've created #7978 to deprecate them.
The modes are currently supported for image creation, converting to the mode, access, unpacking and Introducing a breaking change to a feature at the same time as deprecating it seems counterproductive.
I don't see anything special about converting RGB to BGR;15 or BGR;16 that means we need packers for them specifically. If you want to restructure packers, unpackers and converters in general, then I suggest you start a new conversation about that. |
How does packing work without a packer? There is currently a packer from BGR;15/16 to BGR;15/16, but there is not a packer from RGB to BGR;15/16. There already are unpackers from BGR;15/16 to RGB. |
You think that Pillow is currently packing without a packer, for some scenario? Could you provide an example of that scenario?
...so? I don't see how that contradicts anything, or why there would have to be at the moment.
Yes. I think you're drifting off-topic from BGR;* scaling, and this would be better asked in a new conversation. |
#7978 has been merged, deprecating these modes, so I'm in favour of closing this, rather than introducing a breaking change to deprecated functionality. |
Currently when getting a BGR;15/16 pixel value, the result is scaled from 0-31 to 0-255.
Pillow/src/libImaging/Access.c
Lines 90 to 108 in de18f55
Storing one of these pixels is also scaled, though using a different algorithm.
Pillow/src/_imaging.c
Lines 607 to 623 in de18f55
Should scaling be done at all for these modes when getting/setting pixels? Also, the pixel order is backwards. It seems that these functions are actually converting to/from RGB rather than just returning the BGR;15/16 values.
The text was updated successfully, but these errors were encountered: