From d8f6a6697b3cf3efea84e35e51856c9d102df355 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Sun, 1 Feb 2015 10:05:40 -0600 Subject: [PATCH] Do not add alpha channel to CMYK images --- skimage/io/_plugins/pil_plugin.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/skimage/io/_plugins/pil_plugin.py b/skimage/io/_plugins/pil_plugin.py index f07fc6f9..e2108145 100644 --- a/skimage/io/_plugins/pil_plugin.py +++ b/skimage/io/_plugins/pil_plugin.py @@ -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 '