[Tutor] Finding difference in two .gif

Ertl, John john.ertl at fnmoc.navy.mil
Fri Sep 30 17:50:52 CEST 2005


Well I found the answer...getbox() gave me the bounding box and then I could
just plot that portion of the two images.
Python 2.4, PIL 1.1.5
The simple code I have tried:

import Image
import ImageChops

file1 = Image.open("/home/PT04_RH.2005072300.gif")

file2 = Image.open("/home/PT04_RH.2005093000.gif")

            diffbox = ImageChops.difference(file1,file2).getbbox()
            diffImage = file1.crop(diffbox)

Tutor maillist  -  Tutor at python.org

More information about the Tutor mailing list