Index: imageConversion.py |
=================================================================== |
--- a/imageConversion.py |
+++ b/imageConversion.py |
@@ -19,7 +19,12 @@ |
import re |
from StringIO import StringIO |
-import PIL.Image |
+try: |
+ from PIL import Image |
+ from PIL import ImageOps |
+except ImportError: |
+ import Image |
+ import ImageOps |
def get_alpha(image): |
if image.mode in ('RGBA', 'LA'): |
@@ -72,8 +77,6 @@ |
return image |
def filter_contrastToAlpha(image, baseDir): |
- import PIL.ImageOps |
- |
alpha = PIL.Image.new('L', image.size, 255) |
alpha.paste(image, mask=get_alpha(image)) |
alpha = PIL.ImageOps.invert(alpha) |