I want to compare two images and then decide whether they are the same or not but the PIL library is not able to tell me the correct result. Even I use both ways to compare them it returns true for two different grayscale images.
difference = ImageChops.difference(image1.convert('L'), image2.convert('L'))
if not difference.getbbox() and list(image1.convert('L').getdata()) == list(image2.convert('L').getdata()):
I am using it in this manner but I couldn't handle this problem.
These are the example images for that situation: