diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2019-06-28 23:07:55 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2019-06-28 23:07:55 +0000 |
commit | 11fd0bc3fdbe7b5eb9266a728a81d0bcac91fe32 (patch) | |
tree | 7c40f096dd973943ef563ec87b2a68d8205db4fb /test/ppmmix.test | |
parent | 89c6ec14eb7514630aea5abc4b90b51d1473d33a (diff) | |
download | netpbm-mirror-11fd0bc3fdbe7b5eb9266a728a81d0bcac91fe32.tar.gz netpbm-mirror-11fd0bc3fdbe7b5eb9266a728a81d0bcac91fe32.tar.xz netpbm-mirror-11fd0bc3fdbe7b5eb9266a728a81d0bcac91fe32.zip |
Promote Stable to Super_stable
git-svn-id: http://svn.code.sf.net/p/netpbm/code/super_stable@3640 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test/ppmmix.test')
-rwxr-xr-x | test/ppmmix.test | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/ppmmix.test b/test/ppmmix.test new file mode 100755 index 00000000..e1c6486b --- /dev/null +++ b/test/ppmmix.test @@ -0,0 +1,33 @@ +#! /bin/bash +# This script tests: ppmmix +# Also requires: pamdepth pamenlarge pamsumm pbmmake +# Also requires: pgmtopgm pnminvert ppmtopgm + + +tmpdir=${tmpdir:-/tmp} + +# Test 1. Print a pretty checkerboard pattern +a1_pgm=${tmpdir}/a1.pgm +a2_pgm=${tmpdir}/a2.pgm + +pbmmake -g 8 8 | pgmtopgm > ${a1_pgm} && +pbmmake -g 2 2 | pamenlarge 4 | pgmtopgm > ${a2_pgm} && +ppmmix 0.75 ${a1_pgm} ${a2_pgm} | ppmtopgm | pamdepth 3 -plain && +rm ${a1_pgm} ${a2_pgm} + +# Mix image with itself. +# Output should match input regardless of ratio. +for i in 0 0.5 0.6 1 +do +ppmmix $i testimg.ppm testimg.ppm | cksum +done + +# Mix image with its own inverse. +# Output should be a monotone gray sheet. +a3_ppm=${tmpdir}/a3.ppm + +pnminvert testimg.ppm | ppmmix .5 \ + testimg.ppm - | tee ${a3_ppm} | \ + pamsumm -brief -max && + pamsumm -brief -min ${a3_ppm} && +rm ${a3_ppm} |