Added has_transparency_data#7420
Merged
hugovk merged 6 commits intopython-pillow:mainfrom Sep 30, 2023
Merged
Conversation
homm
reviewed
Sep 25, 2023
|
Hi @radarhere – thanks for this PR! My only question was going to be whether image palettes support modes other than RGBA, but you've addressed that in your comments to @homm, so from my perspective (of admittedly limited experience), I think it looks great. |
hugovk
reviewed
Sep 26, 2023
Member
hugovk
left a comment
There was a problem hiding this comment.
This could also be a property, any preference?
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Member
Author
|
Sure, that seems like a reasonable idea. I've added a commit to change it to a property. |
faea2bb to
e27d7a6
Compare
homm
approved these changes
Sep 26, 2023
Member
|
Looks good, let's also add to the release notes. |
Member
Author
|
Sure, I've pushed a commit for that. |
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #7384
Adds a method to determine if an image has transparency data - an alpha channel, an RGBA palette or "transparency" in the image's
infodirectory.I chose this method name to try and indicate that the image may still be opaque. For example,
hopper("RGB").convert("RGBA")has an alpha channel, but has no transparent or translucent pixels.In doing so, I found a similar check in WebPImagePlugin.
Pillow/src/PIL/WebPImagePlugin.py
Lines 335 to 340 in b723e9e
So I've changed that to use this new method.