about summary refs log tree commit diff
path: root/test/pamditherbw-random.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/pamditherbw-random.test')
-rwxr-xr-xtest/pamditherbw-random.test23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/pamditherbw-random.test b/test/pamditherbw-random.test
new file mode 100755
index 00000000..7a5de7bd
--- /dev/null
+++ b/test/pamditherbw-random.test
@@ -0,0 +1,23 @@
+#! /bin/sh
+# This script tests: pamditherbw
+# Also requires: pamchannel pamtopnm
+
+tmpdir=${tmpdir:-/tmp}
+test_red=${tmpdir}/testimg.red
+
+# Test 1.  Floyd-Steinberg
+echo "Test: Floyd-Steinberg"
+echo "Should print 3849876047 33894"
+
+pamchannel -infile=testimg.ppm -tupletype="GRAYSCALE" 0 | pamtopnm | \
+  tee ${test_red} | \
+  pamditherbw -fs -randomseed=1 | cksum
+
+
+# Test 2. Atkinson
+echo "Test: Atkinson"
+echo "Should print 2887295695 33894"
+
+pamditherbw -atkinson -randomseed=1 ${test_red} | cksum
+
+rm ${test_red}
\ No newline at end of file