about summary refs log tree commit diff
path: root/test/pamditherbw.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/pamditherbw.test')
-rwxr-xr-xtest/pamditherbw.test27
1 files changed, 13 insertions, 14 deletions
diff --git a/test/pamditherbw.test b/test/pamditherbw.test
index fef71efa..1ac1391c 100755
--- a/test/pamditherbw.test
+++ b/test/pamditherbw.test
@@ -1,35 +1,34 @@
 #! /bin/bash
 # This script tests: pamditherbw
-# Also requires: ppmtopgm
+# Also requires: pamchannel
 
   alias pamditherbw="${PBM_TESTPREFIX}pamditherbw"
-  alias ppmtopgm="${PBM_BINPREFIX}ppmtopgm"
   shopt -s expand_aliases
 
-# Make test input
-ppmtopgm testimg.ppm >${tmpdir}/testimg.pgm
+tmpdir=${tmpdir:-/tmp}
+test_red=${tmpdir}/testimg.red
 
 # Test 1.  Simple threshold
-pamditherbw -threshold -val=0.5 \
-   ${tmpdir}/testimg.pgm | cksum
+pamchannel -infile=testimg.ppm -tupletype="GRAYSCALE" 0 | pamtopnm | \
+  tee ${test_red} | \
+  pamditherbw -threshold -val=0.5 | cksum
 
 # Test 2.  Floyd-Steinberg
-#pamditherbw -floyd -val=0.5 ${tmpdir}/testimg.pgm | cksum
+#pamditherbw -floyd -val=0.5 ${test_red} | cksum
 
 # Test 3. Atkinson
-#pamditherbw -atkinson -val=0.5 ${tmpdir}/testimg.pgm | cksum
+#pamditherbw -atkinson -val=0.5 ${test_red} | cksum
 
 # Test 4. Hilbert
-pamditherbw -hilbert ${tmpdir}/testimg.pgm | cksum
+pamditherbw -hilbert ${test_red} | cksum
 
 # Test 5. Dither-8
-pamditherbw -dither8 ${tmpdir}/testimg.pgm | cksum
+pamditherbw -dither8 ${test_red} | cksum
 
 # Test 6. Cluster4
-pamditherbw -cluster4 ${tmpdir}/testimg.pgm | cksum
+pamditherbw -cluster4 ${test_red} | cksum
 
 # Test 7. Atkinson
-#pamditherbw -atkinson -val=0.5 ${tmpdir}/testimg.pgm | cksum
+#pamditherbw -atkinson -val=0.5 ${test_red} | cksum
 
-# Remove test file
-rm ${tmpdir}/testimg.pgm
+rm ${test_red}