@@ -1864,7 +1864,7 @@ def test_interpolation_stage_rgba_respects_alpha_param(fig_test, fig_ref, intp_s
18641864 axs_ref [0 ][2 ].imshow (im_rgba , interpolation_stage = intp_stage )
18651865
18661866 # When the image already has an alpha channel, multiply it by the
1867- # scalar alpha param, or replace it by the array alpha param
1867+ # alpha param (both scalar and array alpha multiply the existing alpha)
18681868 axs_tst [1 ][0 ].imshow (im_rgba )
18691869 axs_ref [1 ][0 ].imshow (im_rgb , alpha = array_alpha )
18701870 axs_tst [1 ][1 ].imshow (im_rgba , interpolation_stage = intp_stage , alpha = scalar_alpha )
@@ -1876,8 +1876,9 @@ def test_interpolation_stage_rgba_respects_alpha_param(fig_test, fig_ref, intp_s
18761876 new_array_alpha = np .random .rand (ny , nx )
18771877 axs_tst [1 ][2 ].imshow (im_rgba , interpolation_stage = intp_stage , alpha = new_array_alpha )
18781878 axs_ref [1 ][2 ].imshow (
1879- np .concatenate ( # combine rgb channels with new array alpha
1880- (im_rgb , new_array_alpha .reshape ((ny , nx , 1 ))), axis = - 1
1879+ np .concatenate ( # combine rgb channels with multiplied array alpha
1880+ (im_rgb , array_alpha .reshape ((ny , nx , 1 ))
1881+ * new_array_alpha .reshape ((ny , nx , 1 ))), axis = - 1
18811882 ), interpolation_stage = intp_stage
18821883 )
18831884
0 commit comments