We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8591756 commit 5a4f6f0Copy full SHA for 5a4f6f0
lib/matplotlib/image.py
@@ -1688,7 +1688,7 @@ def _pil_png_to_float_array(pil_png):
1688
mode = pil_png.mode
1689
rawmode = pil_png.png.im_rawmode
1690
if rawmode == "1": # Grayscale.
1691
- return np.asarray(pil_png, np.float32)
+ return np.asarray(pil_png).astype(np.float32)
1692
if rawmode == "L;2": # Grayscale.
1693
return np.divide(pil_png, 2**2 - 1, dtype=np.float32)
1694
if rawmode == "L;4": # Grayscale.
0 commit comments