Skip to content

Commit

Permalink
Fix image alpha in PNG backend
Browse files Browse the repository at this point in the history
  • Loading branch information
mdboom committed Jun 28, 2016
1 parent f3895f9 commit 22806ae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/matplotlib/tests/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,13 @@ def test_image_alpha():
np.random.seed(0)
Z = np.random.rand(6, 6)

plt.subplot(121)
plt.subplot(131)
plt.imshow(Z, alpha=1.0, interpolation='none')

plt.subplot(132)
plt.imshow(Z, alpha=0.5, interpolation='none')

plt.subplot(122)
plt.subplot(133)
plt.imshow(Z, alpha=0.5, interpolation='nearest')

@cleanup
Expand Down
1 change: 1 addition & 0 deletions src/_backend_agg_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ static PyObject *PyRendererAgg_draw_image(PyRendererAgg *self, PyObject *args, P
x = mpl_round(x);
y = mpl_round(y);

gc.alpha = 1.0;
CALL_CPP("draw_image", (self->x->draw_image(gc, x, y, image)));

Py_RETURN_NONE;
Expand Down

0 comments on commit 22806ae

Please sign in to comment.