create difference image using Magick++ (via PythonMagick)

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
willjs12
Posts: 1
Joined: 2015-04-30T12:24:10-07:00
Authentication code: 6789

create difference image using Magick++ (via PythonMagick)

Post by willjs12 »

Version: ImageMagick 6.8.9-8 Q16 x86_64 2014-10-23
OSX Yosemite

I'm porting some code that does image comparison from ruby to python. The images being compared are always similar in size and resolution.

I have PythonMagick successfully installed and working.

Problem: How do I compare images and output a difference image (showing different pixels in red with the similar pixels faded) with Magick++ (via PythonMagick)? Note that PyhonMagick does not expose MagickCore (as far as I can tell). I imagine I need to break it into multiple steps, but what exactly are the steps?

Command line equivalent: compare -metric AE file1.png file2.png diff.png

Ruby equivalent (via RMagick): diff_img, pixels = img1.compare_channel(img2, Magick::AbsoluteErrorMetric)

Thanks!
Post Reply