"john taylor" wrote:

> i want to compare two images, they are of the same
> mode ('RGB'), same format ('BMP'), same size, etc.

here's a reasonably fast way to compare two images:

def compare(im1, im2):
    import ImageChops
    if im1.mode != im2.mode or im1.size != im2.size:
        return 0
    try:
        return ImageChops.difference(im1, im2).getbbox() is None
    except ValueError:
        return im1.tostring() == im2.tostring()

I think the logical operators (which are undocumented) only work on
mode "1" images.

</F> 



_______________________________________________
Image-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/image-sig

Reply via email to