From 8c60f7834da66b447dd8c2f6533cfe2b13fb27b3 Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Tue, 12 Dec 2017 23:39:09 +1300 Subject: [PATCH] Add alpha compositing note to "matplotlib.pyplot.imshow" definition. References matplotlib/matplotlib#9906 and matplotlib/matplotlib#9959. --- lib/matplotlib/axes/_axes.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 85dcc041d089..27efb72b62e0 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -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: