Do not add alpha channel to CMYK images

This commit is contained in:
Steven Silvester
2015-02-01 10:05:40 -06:00
parent 3728c61615
commit d8f6a6697b
+4 -1
View File
@@ -90,9 +90,12 @@ def pil_to_ndarray(im, dtype=None, img_num=None):
elif im.mode == '1':
frame = im.convert('L')
elif 'A' in im.mode or im.mode == 'CMYK':
elif 'A' in im.mode:
frame = im.convert('RGBA')
elif im.mode == 'CMYK':
frame = im.convert('RGB')
if im.mode.startswith('I;16'):
shape = im.size
dtype = '>u2' if im.mode.endswith('B') else '<u2'