We Recommend

Learning Python Learning Python
The authors of Learning Python show you enough essentials of the Python scripting language to enable you to begin solving problems right away, then reveal more powerful aspects of the language one at a time. This approach is sure to appeal to programmers and system administrators who have urgent problems and a preference for learning by semi-guided experimentation.


Posted By

sudarkoff on 08/09/06


Tagged

python image-processing PIL RMS difference


Versions (?)


Who likes this?

2 people have marked this snippet as a favorite

mthorn
anayhk


Compare two PIL images in Python


Published in: Python 


URL: http://mail.python.org/pipermail/image-sig/1997-March/000223.html

  1. h1 = Image.open("image1").histogram()
  2. h2 = Image.open("image2").histogram()
  3.  
  4. rms = math.sqrt(reduce(operator.add,
  5. map(lambda a,b: (a-b)**2, h1, h2))/len(h1))

Report this snippet 

You need to login to post a comment.