15. ImageChops multiply
15.1. Multiply
Use the
ImageChops.multiply(image1, image2)
method to overlay 2 images of the same size.If an image is multiplied with an image with a solid black image, the result is black.
If an image is multiplied with a solid white image, the image is unaffected.
out = image1 * image2 / MAX
from PIL import Image, ImageChops
with Image.open("test_images/crosses.png") as im1:
with Image.open("test_images/circles.png") as im2:
im_out = ImageChops.multiply(im1, im2)
im_out.save("chops/multiply.png")