def near_identical(im1, im2):
    diff = ImageChops.difference(im1, im2).histogram()
    for color in diff[2:]:
        if color:
            return False
    return True
Check if two images are identical (or near enough).
dataset/ETHPy150Open SmileyChris/easy-thumbnails/easy_thumbnails/tests/test_source_generators.py/near_identical