Created
December 7, 2016 08:03
-
-
Save tag1216/5e9d8540a90ea26d5e6676e64d8360b6 to your computer and use it in GitHub Desktop.
Python Pillow で透過画像の判定
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
from PIL import Image | |
img = Image.open("test.png") | |
if img.mode == 'RGBA' or "transparency" in img.info: | |
print("透過画像") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment