OR operation of two two black and white images using PIL/Pillow

Viewed 950

I'd like to perform an OR operation on two images using PIL/Pillow. Currently I'm doing something like this:

def image_union(figure1, figure2):

    image1 = Image.open(figure1.visualFilename)
    image2 = Image.open(figure2.visualFilename)

    blended = Image.blend(image1, image2, .5)
    output = ImageOps.grayscale(blended)
    output.save('out-' + figure1.name + '-' + figure2.name + '.png')

    return blended

I'd like to OR these two images:

enter image description here

enter image description here

but the above operation returns the following, whereas I would expect the two bottom circles attached to the star to be fully black:

enter image description here

1 Answers
Related