You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix black corners when rotating RGB images by converting to RGBA in
make_image
Fixes#29300.
This patch ensures that RGB uint8 images (shape HxWx3) are
internally converted to RGBA (with opaque alpha) before
rendering in `AxesImage.make_image`. This prevents resampling
artifacts (e.g., black corners) when applying affine
transformations like rotation, particularly for `imshow()`.
The fix is applied late in the rendering pipeline (inside
`make_image`) to avoid changing behavior for PIL images or
breaking baseline tests that rely on specific colormap or
interpolation behavior.
Two tests are added:
- `test_rgb_array_converted_to_rgba`: ensures RGB NumPy input
is upgraded to RGBA
- `test_rotate_rgb_image_no_black_background`: verifies fix but
is marked xfail due to backend resampling limitations
No test baselines are changed. This fix is scoped and
backend-compatible.
0 commit comments