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

Skip to content

Commit cfb648f

Browse files
authored
Merge pull request #9981 from colour-science/feature/doc_imshow
DOC: Add alpha compositing note to "matplotlib.pyplot.imshow" definition.
2 parents 8d60d54 + 8c60f78 commit cfb648f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5129,6 +5129,16 @@ def imshow(self, X, cmap=None, norm=None, aspect=None,
51295129
coordinates. In other words: the origin will coincide with the center
51305130
of pixel (0, 0).
51315131
5132+
Two typical representations are used for RGB images with an alpha
5133+
channel:
5134+
5135+
- Straight (unassociated) alpha: R, G, and B channels represent the
5136+
color of the pixel, disregarding its opacity.
5137+
- Premultiplied (associated) alpha: R, G, and B channels represent
5138+
the color of the pixel, adjusted for its opacity by multiplication.
5139+
5140+
`~matplotlib.pyplot.imshow` expects RGB images adopting the straight
5141+
(unassociated) alpha representation.
51325142
"""
51335143

51345144
if not self._hold:

0 commit comments

Comments
 (0)