mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-14 11:18:06 +08:00
Do not add alpha channel to CMYK images
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user