Skip to content

Conversation

@radarhere
Copy link
Member

Resolves #9051

Currently,alpha_composite() can only use RGBA images. This expands it to allow RGBA or LA images - although the input images must have the same mode.

}

if (strcmp(imDst->mode, imSrc->mode) || imDst->type != imSrc->type ||
imDst->bands != imSrc->bands || imDst->xsize != imSrc->xsize ||
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the images are the same mode, then they will naturally have the same type and number of bands.

@hugovk hugovk merged commit 9a2c516 into python-pillow:main Aug 27, 2025
67 of 69 checks passed
@radarhere radarhere deleted the alpha_composite branch August 27, 2025 20:07
radarhere added a commit to radarhere/Pillow that referenced this pull request Oct 12, 2025
hugovk added a commit to hugovk/Pillow that referenced this pull request Oct 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Image.alpha_composite does not work with images of type "LA"

2 participants