How to check if image is transparent #7742
Answered
by
radarhere
SohamTilekar
asked this question in
Q&A
-
How To Find Whether Pillow image is transparent or not.
Below is the My Solution.
Is there any more efficient way? |
Beta Was this translation helpful? Give feedback.
Answered by
radarhere
Jan 22, 2024
Replies: 1 comment
-
Your code is similar to See https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.Image.has_transparency_data for documentation |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
SohamTilekar
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your code is similar to
img.has_transparency_data
- so I imagine that is what you're looking for. It is an attribute that reports if an image has any transparency data or not.See https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.Image.has_transparency_data for documentation