Add handling of CMYK images

This commit is contained in:
Steven Silvester
2015-01-30 19:53:26 -06:00
parent 1992c35a25
commit a188380ba8
+2 -3
View File
@@ -73,7 +73,7 @@ def pil_to_ndarray(im, dtype=None, img_num=None):
frame = im
if not img_num is None and img_num != i:
if img_num is not None and img_num != i:
im.getdata()[0]
i += 1
continue
@@ -90,10 +90,9 @@ def pil_to_ndarray(im, dtype=None, img_num=None):
elif im.mode == '1':
frame = im.convert('L')
elif 'A' in im.mode:
elif 'A' in im.mode or im.mode == 'CMYK':
frame = im.convert('RGBA')
if im.mode.startswith('I;16'):
shape = im.size
dtype = '>u2' if im.mode.endswith('B') else '<u2'