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

Skip to content

DOC: Add alpha compositing note to "matplotlib.pyplot.imshow" definition. #9981

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 1 commit into from
Dec 12, 2017
Merged
Changes from all commits
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
Add alpha compositing note to "matplotlib.pyplot.imshow" definition.
References #9906 and #9959.
  • Loading branch information
KelSolaar committed Dec 12, 2017
commit 8c60f7834da66b447dd8c2f6533cfe2b13fb27b3
10 changes: 10 additions & 0 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5129,6 +5129,16 @@ def imshow(self, X, cmap=None, norm=None, aspect=None,
coordinates. In other words: the origin will coincide with the center
of pixel (0, 0).

Two typical representations are used for RGB images with an alpha
channel:

- Straight (unassociated) alpha: R, G, and B channels represent the
color of the pixel, disregarding its opacity.
- Premultiplied (associated) alpha: R, G, and B channels represent
the color of the pixel, adjusted for its opacity by multiplication.

`~matplotlib.pyplot.imshow` expects RGB images adopting the straight
(unassociated) alpha representation.
"""

if not self._hold:
Expand Down