Skip to content

Instantly share code, notes, and snippets.

@w0rm
Created March 28, 2014 17:02
Show Gist options
  • Save w0rm/9837645 to your computer and use it in GitHub Desktop.
Save w0rm/9837645 to your computer and use it in GitHub Desktop.
Fix png images for compass sprite generator
#!/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)
@w0rm
Copy link
Author

w0rm commented Mar 28, 2014

This is the only evidence of the problem that I have found: https://groups.google.com/forum/#!topic/compass-users/U6xMb5INZhA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment