Skip to content

Commit a44ed2f

Browse files
committed
Premultiply color-mapped images, since that is what the backends expect.
1 parent 94155fb commit a44ed2f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/matplotlib/image.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ def _get_unsampled_image(self, A, image_extents, viewlim):
200200
else:
201201
if self._rgbacache is None:
202202
x = self.to_rgba(self._A, bytes=True)
203+
# premultiply the colors
204+
x[...,0:3] *= x[...,3:4] / 255.0
203205
self._rgbacache = x
204206
else:
205207
x = self._rgbacache

0 commit comments

Comments
 (0)