[Tutor] Finding difference in two .gif

2005-09-30 Thread Ertl, John
 
All,

I have two gif images that should be exactly the same...one static and the
other recreated from the same data. For months this has been working great
but yesterday the new image that I made was slightly different.  The image
size is 4 bytes different.  When I look at the image side by side I can not
see the difference.  I have very limited image manipulation software and I
was trying to isolate the image difference using PIL but all I get are black
images. I know nothing about how the imaging works so it could be as easy as
reseting the scale but I tried with no luck. 

Does anyone know how to isolate (hopefully small) image differences using
PIL?

Thank you,

John Ertl

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)

#diffImage = ImageChops.difference(file1,file2)

diffImage = ImageChops.subtract(file1,file2)



diffImage.save(diffOut.gif)
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Finding difference in two .gif

2005-09-30 Thread Ertl, John

All,

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)

diffImage.save(diffOut.gif)
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor