ImageDiff
ImageDiff
tests compare images created by postprocessing of simulations. This is usually generated by a Python postprocessing script, but it would support images natively generated by any application.
ImageDiff
uses matplotlib.pyplot.imread
in the backend to load the images, so the image format for an ImageDiff
test should be supported by this reader.
Options
Test configuration options are added to the tests
file.
imagediff
: A list of files to compare against the goldallowed
: Minimum acceptable similarity (structural similarity index) between the images, defaults to 0.98allowed_linux
: Similarity cutoff used for linux machines, if not provided 'allowed' is usedallowed_darwin
: Similarity cutoff used for Mac OS (Darwin) machines, if not provided 'allowed' is used
Other test commands & restrictions may be found in the TestHarness documentation.
Example test configuration in the MOOSE test suite
In this example, the ImageDiff
tester is used to check that the plots of the spatial distributions of temperature in the simulation, output to CSV
then plotted by a python script, match reference images.