I try to overlay two images but the result is not what I want.
I get this image where the color of hair is white:
Here iis the code"
from PIL import Image, ImageChops
# Load the images
image1 = Image.open('C:/Users/asus/Desktop/Testing/hairoccluded/ISIC_0024327.jpg')
image2 = Image.open('C:/Users/asus/Desktop/Testing/hairfree/ISIC_0024327.jpg')
# Subtract image2 from image1
subtracted_image = ImageChops.subtract(image2, image1)
# Reverse the subtraction using ImageChops.add
reversed_image = ImageChops.add(image2, subtracted_image)
# Display the reversed image
reversed_image.show(