Skip to content

Comments

Fix alpha array ignored for RGB images in imshow. #31171

Open
matthewlos wants to merge 1 commit intomatplotlib:mainfrom
matthewlos:fix-alpha-array-rgb-imageshow
Open

Fix alpha array ignored for RGB images in imshow. #31171
matthewlos wants to merge 1 commit intomatplotlib:mainfrom
matthewlos:fix-alpha-array-rgb-imageshow

Conversation

@matthewlos
Copy link

@matthewlos matthewlos commented Feb 18, 2026

Array alpha was silently ignored when passing RGB image data to imshow(). For RGBA images, array alpha replaced the existing alpha channel instead of multiplying with it.

Now array alpha is used directly for RGB (3-channel) input, and multiplied with the existing alpha channel for RGBA (4-channel) input, consistent with scalar alpha behavior.

Closes #26092

PR summary

PR checklist

Array alpha was silently ignored when passing RGB image data to
imshow(). For RGBA images, array alpha replaced the existing alpha
channel instead of multiplying with it.

Now array alpha is used directly for RGB (3-channel) input, and
multiplied with the existing alpha channel for RGBA (4-channel)
input, consistent with scalar alpha behavior.

Closes matplotlib#26092
@github-actions
Copy link

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks.

You can also join us on gitter for real-time discussion.

For details on testing, writing docs, and our review process, please see the developer guide.
Please let us know if (and how) you use AI, it will help us give you better feedback on your PR.

We strive to be a welcoming and open project. Please follow our Code of Conduct.

@ayshih
Copy link
Contributor

ayshih commented Feb 19, 2026

This PR has identical code changes as #30795.

Array alpha was silently ignored when passing RGB image data to imshow().

As a correction to what is written, this first bug was already fixed a long time ago, so is not something fixed by this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: alpha array-type not working with RGB image in imshow()

2 participants