Skip to content

Commit 9390e56

Browse files
committed
Also consider other alpha modes
1 parent e10cab4 commit 9390e56

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/libImaging/Paste.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,13 @@ fill_mask_L(Imaging imOut, const UINT8* ink, Imaging imMask,
380380
for (x = 0; x < xsize; x++) {
381381
for (i = 0; i < pixelsize; i++) {
382382
UINT8 channel_mask = *mask;
383-
if (strcmp(imOut->mode, "RGBA") == 0 && i != 3) {
383+
if ((
384+
strcmp(imOut->mode, "RGBa") == 0 ||
385+
strcmp(imOut->mode, "RGBA") == 0 ||
386+
strcmp(imOut->mode, "La") == 0 ||
387+
strcmp(imOut->mode, "LA") == 0 ||
388+
strcmp(imOut->mode, "PA") == 0
389+
) && i != 3) {
384390
channel_mask = 255 - (255 - channel_mask) * (1 - (255 - out[3]) / 255);
385391
}
386392
out[i] = BLEND(channel_mask, out[i], ink[i], tmp1);

0 commit comments

Comments
 (0)