Skip to content

How to check if image is transparent #7742

Answered by radarhere
SohamTilekar asked this question in Q&A
Discussion options

You must be logged in to vote

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

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by SohamTilekar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants