about summary refs log tree commit diff
path: root/test/pamditherbw-random.test
blob: 7a5de7bd1308fab5f31ebf22a5e6d6f2a59fbce1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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}