Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 56269d8

Browse files
authored
Merge pull request #20568 from meeseeksmachine/auto-backport-of-pr-20565-on-v3.4.x
Backport PR #20565 on branch v3.4.x (FIX: PILLOW asarray bug)
2 parents 156a0f6 + 4ff7827 commit 56269d8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/matplotlib/image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1661,7 +1661,7 @@ def _pil_png_to_float_array(pil_png):
16611661
mode = pil_png.mode
16621662
rawmode = pil_png.png.im_rawmode
16631663
if rawmode == "1": # Grayscale.
1664-
return np.asarray(pil_png, np.float32)
1664+
return np.asarray(pil_png).astype(np.float32)
16651665
if rawmode == "L;2": # Grayscale.
16661666
return np.divide(pil_png, 2**2 - 1, dtype=np.float32)
16671667
if rawmode == "L;4": # Grayscale.

0 commit comments

Comments
 (0)