diff --git a/skimage/io/_plugins/pil_plugin.py b/skimage/io/_plugins/pil_plugin.py index 09d51c7a..f07fc6f9 100644 --- a/skimage/io/_plugins/pil_plugin.py +++ b/skimage/io/_plugins/pil_plugin.py @@ -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 '