-
-
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
Added alpha_only argument to getbbox() #7123
Conversation
|
I've pushed a commit to rename it to |
It can be a separate change, but should this new parameter be exposed to the public api? |
Ok, I've added an |
I've been using a local build with this patch for a few weeks now and it's been working well, hopefully we can get this merged soon :) |
Be aware that even if it is merged, Pillow 10.0.0 is not due out until July 1. |
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
I've added a commit to resolve #7207 - the change involves the same logic presented initially for PngImagePlugin, just this time for GifImagePlugin. |
Pillow 10.0.0 has now been released with this fix. |
Resolves #7207
Resolves #7122
When saving APNG frames, APNG converts the individual frames to RGB to check if there are any differences. If there aren't, then it is a duplicate frame, and can be combined with the previous one to save space.
Pillow/src/PIL/PngImagePlugin.py
Lines 1140 to 1151 in d1731b3
However, the issue tries to save RGBA frames that become identical when converted to RGB. So instead, this PR changes the code to convert the frames to RGBA.
Except that then introduces a new problem. If two frames have the same alpha values, then
ImageChops.subtract_modulo()
returns a image showing that there is 0 alpha difference... when is then interpreted bygetbbox()
as a fully transparent image, meaning that as per #4454, it ignores whatever RGB information there might be.So this PR adds an argument to the C
getbbox()
to allow it to turn off the special treatment of the alpha channel.