K
Kevin D. Smith
I'm trying to get the difference of two images using PIL. The
ImageChops.difference function does almost what I want, but it takes
the absolute value of the pixel difference. What I want is a two color
output image: black where the image wasn't different, and white where
it was different. Right now I get black where it wasn't different, and
abs(image1-image2) where it was different.
It would be nice if I could specify the colors for difference and no
difference. This sounds like it should be easy, but I just don't see
how to do it.
ImageChops.difference function does almost what I want, but it takes
the absolute value of the pixel difference. What I want is a two color
output image: black where the image wasn't different, and white where
it was different. Right now I get black where it wasn't different, and
abs(image1-image2) where it was different.
It would be nice if I could specify the colors for difference and no
difference. This sounds like it should be easy, but I just don't see
how to do it.