-
-
Save xiaody/c20dcf9cdf61bd10ccd1 to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/env python | |
# | |
# Script to convert png files to RGBA color space | |
# Requires Pillow (pip install Pillow) | |
# | |
import os | |
import fnmatch | |
from PIL import Image | |
for root, dirnames, filenames in os.walk('sprites'): | |
for filename in fnmatch.filter(filenames, '*.png'): | |
image_path = os.path.join(root, filename) | |
print image_path | |
Image.open(image_path).convert('RGBA').save(image_path) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment