I have two images, both with alpha channels. I want to put one image over the other, resulting in a new image with an alpha channel, just as would occur if they were rendered in layers. I would like to do this with the Python Imaging Library, but recommendations in other systems would be fantastic, even the raw math would be a boon; I could use NumPy.
Share
I couldn’t find an alpha composite function in PIL, so here is my attempt at implementing it with numpy:
For example given these two images,
alpha_compositeproduces: