about summary refs log tree commit diff
path: root/test/pnmcolormap2.test
blob: cea521aa686e4480de7e543f8042e6a73fcb7b57 (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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
#! /bin/sh
# This script tests: pnmcolormap
# Also requires: pnmremap pnmpsnr

tmpdir=${tmpdir:-/tmp}
map=${tmpdir}/map.ppm

echo "Test.  Should print 'match' eighteen times."

# Threshold values (tgtN=xx.xx) were produced by calculating
# the S/N ratio when the original image is compared against a
# reference image with fewer colors than the target output image.

# colors in following tests / colors for calculating threshold
# 256 / 224
# 128 /  96  -splitspread
# 128 / 108  other
#  64 /  44  -center (default)
#  64 /  48  -splitspread
#  64 /  56  other

# -center
echo pnmcolormap  256
tgt1=37.19;  tgt2=37.86;  tgt3=37.77
pnmcolormap 256 testimg.ppm > ${map}
pnmremap -mapfile=${map} testimg.ppm |\
pnmpsnr -target1=${tgt1} -target2=${tgt2} -target3=${tgt3} testimg.ppm -
rm ${map}

echo pnmcolormap  128
tgt1=34.46;  tgt2=35.61;  tgt3=34.97
pnmcolormap 128 testimg.ppm > ${map}
pnmremap -mapfile=${map} testimg.ppm |\
pnmpsnr -target1=${tgt1} -target2=${tgt2} -target3=${tgt3} testimg.ppm -
rm ${map}

echo pnmcolormap  64
tgt1=30.30;  tgt2=33.10;  tgt3=31.74
pnmcolormap 64 testimg.ppm > ${map}
pnmremap -mapfile=${map} testimg.ppm |\
pnmpsnr -target1=${tgt1} -target2=${tgt2} -target3=${tgt3} testimg.ppm -
rm ${map}

echo pnmcolormap -meancolor 256
tgt1=38.36;  tgt2=38.63;  tgt3=38.95
pnmcolormap -meancolor 256 testimg.ppm > ${map}
pnmremap -mapfile=${map} testimg.ppm |\
pnmpsnr -target1=${tgt1} -target2=${tgt2} -target3=${tgt3} testimg.ppm -
rm ${map}

echo pnmcolormap -meancolor 128
tgt1=35.86;  tgt2=37.17;  tgt3=36.65
pnmcolormap -meancolor 128 testimg.ppm > ${map}
pnmremap -mapfile=${map} testimg.ppm |\
pnmpsnr -target1=${tgt1} -target2=${tgt2} -target3=${tgt3} testimg.ppm -
rm ${map}

echo pnmcolormap -meancolor 64
tgt1=33.64;  tgt2=34.92;  tgt3=34.44
pnmcolormap -meancolor 64 testimg.ppm > ${map}
pnmremap -mapfile=${map} testimg.ppm |\
pnmpsnr -target1=${tgt1} -target2=${tgt2} -target3=${tgt3} testimg.ppm -
rm ${map}

echo pnmcolormap -meanpixel 256
tgt1=38.40;  tgt2=38.65;  tgt3=38.90
pnmcolormap -meanpixel 256 testimg.ppm > ${map}
pnmremap -mapfile=${map} testimg.ppm |\
pnmpsnr -target1=${tgt1} -target2=${tgt2} -target3=${tgt3} testimg.ppm -
rm ${map}

echo pnmcolormap -meanpixel 128
tgt1=35.75;  tgt2=37.13;  tgt3=36.69
pnmcolormap -meanpixel 128 testimg.ppm > ${map}
pnmremap -mapfile=${map} testimg.ppm |\
pnmpsnr -target1=${tgt1} -target2=${tgt2} -target3=${tgt3} testimg.ppm -
rm ${map}

echo pnmcolormap -meanpixel 64
tgt1=33.75;  tgt2=34.79;  tgt3=34.53
pnmcolormap -meanpixel 64 testimg.ppm > ${map}
pnmremap -mapfile=${map} testimg.ppm |\
pnmpsnr -target1=${tgt1} -target2=${tgt2} -target3=${tgt3} testimg.ppm -
rm ${map}

echo pnmcolormap -spreadluminosity 256
tgt1=36.82;  tgt2=36.87;  tgt3=37.25
pnmcolormap -spreadluminosity 256 testimg.ppm > ${map}
pnmremap -mapfile=${map} testimg.ppm |\
pnmpsnr -target1=${tgt1} -target2=${tgt2} -target3=${tgt3} testimg.ppm -
rm ${map}

echo pnmcolormap -spreadluminosity 128
tgt1=34.61;  tgt2=33.40;  tgt3=34.66
pnmcolormap -spreadluminosity 128 testimg.ppm > ${map}
pnmremap -mapfile=${map} testimg.ppm |\
pnmpsnr -target1=${tgt1} -target2=${tgt2} -target3=${tgt3} testimg.ppm -
rm ${map}

echo pnmcolormap -spreadluminosity 64
tgt1=32.35;  tgt2=30.23;  tgt3=32.35
pnmcolormap -spreadluminosity 64 testimg.ppm > ${map}
pnmremap -mapfile=${map} testimg.ppm |\
pnmpsnr -target1=${tgt1} -target2=${tgt2} -target3=${tgt3} testimg.ppm -
rm ${map}

echo pnmcolormap -splitcolorct 256
tgt1=37.55;  tgt2=38.37;  tgt3=38.04
pnmcolormap -splitcolorct 256 testimg.ppm > ${map}
pnmremap -mapfile=${map} testimg.ppm |\
pnmpsnr -target1=${tgt1} -target2=${tgt2} -target3=${tgt3} testimg.ppm -
rm ${map}

echo pnmcolormap -splitcolorct 128
tgt1=34.84;  tgt2=35.72;  tgt3=34.64
pnmcolormap -splitcolorct 128 testimg.ppm > ${map}
pnmremap -mapfile=${map} testimg.ppm |\
pnmpsnr -target1=${tgt1} -target2=${tgt2} -target3=${tgt3} testimg.ppm -
rm ${map}

echo pnmcolormap -splitcolorct 64
tgt1=31.56;  tgt2=33.74;  tgt3=32.93
pnmcolormap -splitcolorct 64 testimg.ppm > ${map}
pnmremap -mapfile=${map} testimg.ppm |\
pnmpsnr -target1=${tgt1} -target2=${tgt2} -target3=${tgt3} testimg.ppm -
rm ${map}

echo pnmcolormap -splitspread 256
tgt1=35.18;  tgt2=37.26;  tgt3=36.17
pnmcolormap -splitspread 256 testimg.ppm > ${map}
pnmremap -mapfile=${map} testimg.ppm |\
pnmpsnr -target1=${tgt1} -target2=${tgt2} -target3=${tgt3} testimg.ppm -
rm ${map}

echo pnmcolormap -splitspread 128
tgt1=33.18;  tgt2=35.58;  tgt3=33.71
pnmcolormap -splitspread 128 testimg.ppm > ${map}
pnmremap -mapfile=${map} testimg.ppm |\
pnmpsnr -target1=${tgt1} -target2=${tgt2} -target3=${tgt3} testimg.ppm -
rm ${map}

echo pnmcolormap -splitspread 64
tgt1=31.27;  tgt2=33.03;  tgt3=30.97
pnmcolormap -splitspread 64 testimg.ppm > ${map}
pnmremap -mapfile=${map} testimg.ppm |\
pnmpsnr -target1=${tgt1} -target2=${tgt2} -target3=${tgt3} testimg.ppm -
rm ${map}