Skip to content

Instantly share code, notes, and snippets.

@hhatto
Created March 26, 2011 13:56
Show Gist options
  • Save hhatto/888295 to your computer and use it in GitHub Desktop.
Save hhatto/888295 to your computer and use it in GitHub Desktop.
pgmagick image diff
from pgmagick import Image
from pgmagick import CompositeOperator as co
img_a = Image('a.jpg')
img_b = Image('b.jpg')
img_c = Image('c.jpg')
print img_a.compare(img_b)
print img_a.compare(img_c)
#img_a.composite(img_b, 0, 0, co.DifferenceCompositeOp)
img_a.composite(img_c, 0, 0, co.DifferenceCompositeOp)
img_a.write('diff.jpg')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment