Skip to content

Commit

Permalink
Premultiply color-mapped images, since that is what the backends expect.
Browse files Browse the repository at this point in the history
  • Loading branch information
mdboom committed Jan 5, 2012
1 parent 94155fb commit a44ed2f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/matplotlib/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ def _get_unsampled_image(self, A, image_extents, viewlim):
else:
if self._rgbacache is None:
x = self.to_rgba(self._A, bytes=True)
# premultiply the colors
x[...,0:3] *= x[...,3:4] / 255.0
self._rgbacache = x
else:
x = self._rgbacache
Expand Down

0 comments on commit a44ed2f

Please sign in to comment.