File: roundtrip

package info (click to toggle)
farbfeld 4-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 196 kB
  • sloc: ansic: 622; sh: 65; makefile: 59
file content (17 lines) | stat: -rwxr-xr-x 591 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

set -e

# https://www.imagemagick.org/Usage/canvas/#random_noise
convert -size 1920x1200 xc: +noise random reference.png

png2ff < reference.png | ff2png > test.png

# When no fuzz value is specified, compare(1) returns 0 when two images are
# identical, and 1 when they differ. This is true with any metric (even with
# the default metric: the normalized cross correlation), but let's use the
# simplest one, Absolute Error, which counts the number of different pixels.
#
# https://www.imagemagick.org/Usage/compare/#compare

compare -metric AE reference.png test.png null: 2>&1