+ using namespace MagickCore;
+
+ Magick::Image ref_image;
+ ref_image.read (ref.string ());
+ Magick::Image check_image;
+ check_image.read (check.string ());
+ /* XXX: this is a hack; we really want the ImageMagick call but GraphicsMagick doesn't have it;
+ this may cause random test failures on platforms that use GraphicsMagick.
+ */
+ double const dist = ref_image.compare(check_image, Magick::RootMeanSquaredErrorMetric);
+ BOOST_CHECK_MESSAGE (dist < threshold, ref << " differs from " << check << " " << dist);