| 1 | #!/bin/sh |
| 2 | |
| 3 | set -e |
| 4 | |
| 5 | # https://www.imagemagick.org/Usage/canvas/#random_noise |
| 6 | convert -size 1920x1200 xc: +noise random reference.png |
| 7 | |
| 8 | png2ff < reference.png | ff2png > test.png |
| 9 | |
| 10 | # When no fuzz value is specified, compare(1) returns 0 when two images are |
| 11 | # identical, and 1 when they differ. This is true with any metric (even with |
| 12 | # the default metric: the normalized cross correlation), but let's use the |
| 13 | # simplest one, Absolute Error, which counts the number of different pixels. |
| 14 | # |
| 15 | # https://www.imagemagick.org/Usage/compare/#compare |
| 16 | |
| 17 | compare -metric AE reference.png test.png null: 2>&1 |