8000 Fix image alpha by mdboom · Pull Request #6659 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Fix image alpha #6659

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 29, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix image alpha in PNG backend
  • Loading branch information
mdboom committed Jun 28, 2016
commit 22806ae919dceef4665bac31dfee69b7c712da5d
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