Project/Section Title



Image Assertions (or Moving from diff to compare)

 The bash command 'diff' works well for doing local testing, but running the image generation on the continuous integration server (Jenkins in this case) gave false positives. At least my eyes could not see any difference between the baseline and proposed images. Maybe the metadata was different, even though the images were the same.

The ImageMagik command 'compare' will be used as the comparator.

Image Comparing with ImageMagiK

compare Usage

This folks on this thread helped me see how to use ImageMagick 'compare' to get at numeric value for the difference; 0 being no difference and larger number mean more differences.

Here is sample usage of 'compare' that prints a numeric value:

$ compare -metric RMSE rounded-pyramid-LEFT-baseline.png rounded-pyramid-LEFT-proposed-baseline.png NULL:
0 (0)

The above command outputs zeros in this case since test images were identical.

Apparently the number is parenthesis () is the number to go with. The following shows a comparison of two images that look identical to the human eye, but are really just a little different in computer representation.

compare -metric RMSE pyramid-from-cylinder-LEFT-baseline.png pyramid-from-cylinder-LEFT-proposed-baseline.png NULL:
9.56788 (0.000145997)



Date Created: 2017-08-11 16:35:25 -0500 (Fri, 11 Aug 2017)

back    |    top