Index: imageConversion.py |
=================================================================== |
--- a/imageConversion.py |
+++ b/imageConversion.py |
@@ -16,17 +16,10 @@ |
import ImageOps |
def get_alpha(image): |
- if image.mode in ('RGBA', 'LA'): |
- return image.split()[image.getbands().index('A')] |
+ if image.mode not in ('RGBA', 'LA'): |
+ image = image.convert("LA") |
- if image.mode == 'P': |
- transparency = image.info.get('transparency') |
- |
- if transparency is not None: |
- table = [255] * 256 |
- table[transparency] = 0 |
- |
- return image.point(table, 'L') |
+ return image.split()[image.getbands().index('A')] |
def load_image(path): |
image = Image.open(path) |