#! /bin/sh # This script tests: pnmcolormap # Also requires: pnmremap pnmpsnr tmpdir=${tmpdir:-/tmp} map=${tmpdir}/map.ppm echo "Test. Should print 'match' eight times." # Threshold values (targetN=xx.xx) here were produced by calculating # the S/N ratio with reduced colors. # colors in following tests / colors for calculating threshold # 100 / 90 # 200 / 180 # 32 / 24 pnmcolormap 100 testimg.ppm > ${map} pnmremap -mapfile=${map} testimg.ppm |\ pnmpsnr -target1=33.75 -target2=35.15 -target3=34.48 testimg.ppm - rm ${map} pnmcolormap -meancolor 100 testimg.ppm > ${map} pnmremap -mapfile=${map} testimg.ppm |\ pnmpsnr -target1=35.05 -target2=36.86 -target3=36.05 testimg.ppm - rm ${map} pnmcolormap -meanpixel 100 testimg.ppm > ${map} pnmremap -mapfile=${map} testimg.ppm |\ pnmpsnr -target1=35.01 -target2=36.80 -target3=36.08 testimg.ppm - rm ${map} pnmcolormap -spreadluminosity 100 testimg.ppm > ${map} pnmremap -mapfile=${map} testimg.ppm |\ pnmpsnr -target1=33.71 -target2=32.89 -target3=34.14 testimg.ppm - rm ${map} pnmcolormap -splitcolorct 100 testimg.ppm > ${map} pnmremap -mapfile=${map} testimg.ppm |\ pnmpsnr -target1=33.97 -target2=35.34 -target3=34.23 testimg.ppm - rm ${map} pnmcolormap -splitspread 100 testimg.ppm > ${map} pnmremap -mapfile=${map} testimg.ppm |\ pnmpsnr -target1=32.98 -target2=35.09 -target3=33.15 testimg.ppm - rm ${map} pnmcolormap 200 testimg.ppm > ${map} pnmremap -mapfile=${map} testimg.ppm |\ pnmpsnr -target1=36.01 -target2=37.07 -target3=36.60 testimg.ppm - rm ${map} pnmcolormap 32 testimg.ppm > ${map} pnmremap -mapfile=${map} testimg.ppm |\ pnmpsnr -target1=28.31 -target2=30.63 -target3=30.26 testimg.ppm - rm ${map}