Allow PIL plugin to read grey-level images with alpha layer.

This commit is contained in:
Stefan van der Walt
2010-06-08 21:25:14 -06:00
parent bd7a15ebaf
commit 3c14b965d6
+4 -1
View File
@@ -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):