mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-12 12:30:16 +08:00
Allow PIL plugin to read grey-level images with alpha layer.
This commit is contained in:
@@ -21,9 +21,12 @@ def imread(fname, as_grey=False, dtype=None):
|
||||
im = im.convert('RGB')
|
||||
|
||||
if as_grey and not \
|
||||
im.mode in ('1', 'L', 'I', 'F', 'I;16', 'I;16L', 'I;16B'):
|
||||
im.mode in ('1', 'L', 'I', 'F', 'I;16', 'I;16L', 'I;16B', 'LA'):
|
||||
im = im.convert('F')
|
||||
|
||||
if 'A' in im.mode:
|
||||
im = im.convert('RGBA')
|
||||
|
||||
return np.array(im, dtype=dtype)
|
||||
|
||||
def _palette_is_grayscale(pil_image):
|
||||
|
||||
Reference in New Issue
Block a user