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

Skip to content

Commit 8665697

Browse files
committed
Use float32 when applying alpha
1 parent 4e43c8b commit 8665697

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ def _make_image(self, A, in_bbox, out_bbox, clip_bbox, magnification=1.0,
348348
if alpha is not None and alpha != 1.0:
349349
alpha_channel = output[:, :, 3]
350350
alpha_channel[:] = np.asarray(
351-
np.asarray(alpha_channel, np.float) * alpha, np.uint8)
351+
np.asarray(alpha_channel, np.float32) * alpha, np.uint8)
352352
else:
353353
if self._imcache is None:
354354
self._imcache = self.to_rgba(A, bytes=True, norm=(A.ndim == 2))

0 commit comments

Comments
 (0)