Thanks to visit codestin.com Credit goes to github.com
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.
2 parents 156a0f6 + 4ff7827 commit 56269d8Copy full SHA for 56269d8
1 file changed
lib/matplotlib/image.py
@@ -1661,7 +1661,7 @@ def _pil_png_to_float_array(pil_png):
1661
mode = pil_png.mode
1662
rawmode = pil_png.png.im_rawmode
1663
if rawmode == "1": # Grayscale.
1664
- return np.asarray(pil_png, np.float32)
+ return np.asarray(pil_png).astype(np.float32)
1665
if rawmode == "L;2": # Grayscale.
1666
return np.divide(pil_png, 2**2 - 1, dtype=np.float32)
1667
if rawmode == "L;4": # Grayscale.
0 commit comments