Skip to content

Commit c1d91e3

Browse files
author
giraffedata
committed
New pnmcolormap2 test
git-svn-id: https://svn.code.sf.net/p/netpbm/code/trunk@4547 9d0c8265-081b-0410-96cb-a4ca84ce46f8
1 parent 73c6013 commit c1d91e3

File tree

2 files changed

+143
-23
lines changed

2 files changed

+143
-23
lines changed

test/pnmcolormap2.ok

+29-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,37 @@
1-
Test. Should print 'match' eight times.
1+
Test. Should print 'match' eighteen times.
2+
pnmcolormap 256
23
match
4+
pnmcolormap 128
35
match
6+
pnmcolormap 64
47
match
8+
pnmcolormap -meancolor 256
59
match
10+
pnmcolormap -meancolor 128
611
match
12+
pnmcolormap -meancolor 64
713
match
14+
pnmcolormap -meanpixel 256
815
match
16+
pnmcolormap -meanpixel 128
17+
match
18+
pnmcolormap -meanpixel 64
19+
match
20+
pnmcolormap -spreadluminosity 256
21+
match
22+
pnmcolormap -spreadluminosity 128
23+
match
24+
pnmcolormap -spreadluminosity 64
25+
match
26+
pnmcolormap -splitcolorct 256
27+
match
28+
pnmcolormap -splitcolorct 128
29+
match
30+
pnmcolormap -splitcolorct 64
31+
match
32+
pnmcolormap -splitspread 256
33+
match
34+
pnmcolormap -splitspread 128
35+
match
36+
pnmcolormap -splitspread 64
937
match

test/pnmcolormap2.test

+114-22
Original file line numberDiff line numberDiff line change
@@ -5,51 +5,143 @@
55
tmpdir=${tmpdir:-/tmp}
66
map=${tmpdir}/map.ppm
77

8-
echo "Test. Should print 'match' eight times."
9-
# Threshold values (targetN=xx.xx) here were produced by calculating
10-
# the S/N ratio with reduced colors.
8+
echo "Test. Should print 'match' eighteen times."
9+
10+
# Threshold values (tgtN=xx.xx) were produced by calculating
11+
# the S/N ratio when the original image is compared against a
12+
# reference image with fewer colors than the target output image.
1113

1214
# colors in following tests / colors for calculating threshold
13-
# 100 / 90
14-
# 200 / 180
15-
# 32 / 24
15+
# 256 / 224
16+
# 128 / 96 -splitspread
17+
# 128 / 108 other
18+
# 64 / 44 -center (default)
19+
# 64 / 48 -splitspread
20+
# 64 / 56 other
21+
22+
# -center
23+
echo pnmcolormap 256
24+
tgt1=37.19; tgt2=37.86; tgt3=37.77
25+
pnmcolormap 256 testimg.ppm > ${map}
26+
pnmremap -mapfile=${map} testimg.ppm |\
27+
pnmpsnr -target1=${tgt1} -target2=${tgt2} -target3=${tgt3} testimg.ppm -
28+
rm ${map}
29+
30+
echo pnmcolormap 128
31+
tgt1=34.46; tgt2=35.61; tgt3=34.97
32+
pnmcolormap 128 testimg.ppm > ${map}
33+
pnmremap -mapfile=${map} testimg.ppm |\
34+
pnmpsnr -target1=${tgt1} -target2=${tgt2} -target3=${tgt3} testimg.ppm -
35+
rm ${map}
36+
37+
echo pnmcolormap 64
38+
tgt1=30.30; tgt2=33.10; tgt3=31.74
39+
pnmcolormap 64 testimg.ppm > ${map}
40+
pnmremap -mapfile=${map} testimg.ppm |\
41+
pnmpsnr -target1=${tgt1} -target2=${tgt2} -target3=${tgt3} testimg.ppm -
42+
rm ${map}
43+
44+
echo pnmcolormap -meancolor 256
45+
tgt1=38.36; tgt2=38.63; tgt3=38.95
46+
pnmcolormap -meancolor 256 testimg.ppm > ${map}
47+
pnmremap -mapfile=${map} testimg.ppm |\
48+
pnmpsnr -target1=${tgt1} -target2=${tgt2} -target3=${tgt3} testimg.ppm -
49+
rm ${map}
50+
51+
echo pnmcolormap -meancolor 128
52+
tgt1=35.86; tgt2=37.17; tgt3=36.65
53+
pnmcolormap -meancolor 128 testimg.ppm > ${map}
54+
pnmremap -mapfile=${map} testimg.ppm |\
55+
pnmpsnr -target1=${tgt1} -target2=${tgt2} -target3=${tgt3} testimg.ppm -
56+
rm ${map}
57+
58+
echo pnmcolormap -meancolor 64
59+
tgt1=33.64; tgt2=34.92; tgt3=34.44
60+
pnmcolormap -meancolor 64 testimg.ppm > ${map}
61+
pnmremap -mapfile=${map} testimg.ppm |\
62+
pnmpsnr -target1=${tgt1} -target2=${tgt2} -target3=${tgt3} testimg.ppm -
63+
rm ${map}
64+
65+
echo pnmcolormap -meanpixel 256
66+
tgt1=38.40; tgt2=38.65; tgt3=38.90
67+
pnmcolormap -meanpixel 256 testimg.ppm > ${map}
68+
pnmremap -mapfile=${map} testimg.ppm |\
69+
pnmpsnr -target1=${tgt1} -target2=${tgt2} -target3=${tgt3} testimg.ppm -
70+
rm ${map}
71+
72+
echo pnmcolormap -meanpixel 128
73+
tgt1=35.75; tgt2=37.13; tgt3=36.69
74+
pnmcolormap -meanpixel 128 testimg.ppm > ${map}
75+
pnmremap -mapfile=${map} testimg.ppm |\
76+
pnmpsnr -target1=${tgt1} -target2=${tgt2} -target3=${tgt3} testimg.ppm -
77+
rm ${map}
78+
79+
echo pnmcolormap -meanpixel 64
80+
tgt1=33.75; tgt2=34.79; tgt3=34.53
81+
pnmcolormap -meanpixel 64 testimg.ppm > ${map}
82+
pnmremap -mapfile=${map} testimg.ppm |\
83+
pnmpsnr -target1=${tgt1} -target2=${tgt2} -target3=${tgt3} testimg.ppm -
84+
rm ${map}
85+
86+
echo pnmcolormap -spreadluminosity 256
87+
tgt1=36.82; tgt2=36.87; tgt3=37.25
88+
pnmcolormap -spreadluminosity 256 testimg.ppm > ${map}
89+
pnmremap -mapfile=${map} testimg.ppm |\
90+
pnmpsnr -target1=${tgt1} -target2=${tgt2} -target3=${tgt3} testimg.ppm -
91+
rm ${map}
1692

17-
pnmcolormap 100 testimg.ppm > ${map}
93+
echo pnmcolormap -spreadluminosity 128
94+
tgt1=34.61; tgt2=33.40; tgt3=34.66
95+
pnmcolormap -spreadluminosity 128 testimg.ppm > ${map}
1896
pnmremap -mapfile=${map} testimg.ppm |\
19-
pnmpsnr -target1=33.75 -target2=35.15 -target3=34.48 testimg.ppm -
97+
pnmpsnr -target1=${tgt1} -target2=${tgt2} -target3=${tgt3} testimg.ppm -
2098
rm ${map}
2199

22-
pnmcolormap -meancolor 100 testimg.ppm > ${map}
100+
echo pnmcolormap -spreadluminosity 64
101+
tgt1=32.35; tgt2=30.23; tgt3=32.35
102+
pnmcolormap -spreadluminosity 64 testimg.ppm > ${map}
23103
pnmremap -mapfile=${map} testimg.ppm |\
24-
pnmpsnr -target1=35.05 -target2=36.86 -target3=36.05 testimg.ppm -
104+
pnmpsnr -target1=${tgt1} -target2=${tgt2} -target3=${tgt3} testimg.ppm -
25105
rm ${map}
26106

27-
pnmcolormap -meanpixel 100 testimg.ppm > ${map}
107+
echo pnmcolormap -splitcolorct 256
108+
tgt1=37.55; tgt2=38.37; tgt3=38.04
109+
pnmcolormap -splitcolorct 256 testimg.ppm > ${map}
28110
pnmremap -mapfile=${map} testimg.ppm |\
29-
pnmpsnr -target1=35.01 -target2=36.80 -target3=36.08 testimg.ppm -
111+
pnmpsnr -target1=${tgt1} -target2=${tgt2} -target3=${tgt3} testimg.ppm -
30112
rm ${map}
31113

32-
pnmcolormap -spreadluminosity 100 testimg.ppm > ${map}
114+
echo pnmcolormap -splitcolorct 128
115+
tgt1=34.84; tgt2=35.72; tgt3=34.64
116+
pnmcolormap -splitcolorct 128 testimg.ppm > ${map}
33117
pnmremap -mapfile=${map} testimg.ppm |\
34-
pnmpsnr -target1=33.71 -target2=32.89 -target3=34.14 testimg.ppm -
118+
pnmpsnr -target1=${tgt1} -target2=${tgt2} -target3=${tgt3} testimg.ppm -
35119
rm ${map}
36120

37-
pnmcolormap -splitcolorct 100 testimg.ppm > ${map}
121+
echo pnmcolormap -splitcolorct 64
122+
tgt1=31.56; tgt2=33.74; tgt3=32.93
123+
pnmcolormap -splitcolorct 64 testimg.ppm > ${map}
38124
pnmremap -mapfile=${map} testimg.ppm |\
39-
pnmpsnr -target1=33.97 -target2=35.34 -target3=34.23 testimg.ppm -
125+
pnmpsnr -target1=${tgt1} -target2=${tgt2} -target3=${tgt3} testimg.ppm -
40126
rm ${map}
41127

42-
pnmcolormap -splitspread 100 testimg.ppm > ${map}
128+
echo pnmcolormap -splitspread 256
129+
tgt1=35.18; tgt2=37.26; tgt3=36.17
130+
pnmcolormap -splitspread 256 testimg.ppm > ${map}
43131
pnmremap -mapfile=${map} testimg.ppm |\
44-
pnmpsnr -target1=32.98 -target2=35.09 -target3=33.15 testimg.ppm -
132+
pnmpsnr -target1=${tgt1} -target2=${tgt2} -target3=${tgt3} testimg.ppm -
45133
rm ${map}
46134

47-
pnmcolormap 200 testimg.ppm > ${map}
135+
echo pnmcolormap -splitspread 128
136+
tgt1=33.18; tgt2=35.58; tgt3=33.71
137+
pnmcolormap -splitspread 128 testimg.ppm > ${map}
48138
pnmremap -mapfile=${map} testimg.ppm |\
49-
pnmpsnr -target1=36.01 -target2=37.07 -target3=36.60 testimg.ppm -
139+
pnmpsnr -target1=${tgt1} -target2=${tgt2} -target3=${tgt3} testimg.ppm -
50140
rm ${map}
51141

52-
pnmcolormap 32 testimg.ppm > ${map}
142+
echo pnmcolormap -splitspread 64
143+
tgt1=31.27; tgt2=33.03; tgt3=30.97
144+
pnmcolormap -splitspread 64 testimg.ppm > ${map}
53145
pnmremap -mapfile=${map} testimg.ppm |\
54-
pnmpsnr -target1=28.31 -target2=30.63 -target3=30.26 testimg.ppm -
146+
pnmpsnr -target1=${tgt1} -target2=${tgt2} -target3=${tgt3} testimg.ppm -
55147
rm ${map}

0 commit comments

Comments
 (0)