about summary refs log tree commit diff
path: root/test/pnmremap2.test
blob: 7eea2c4a348f7b5130bb425138bfee7f4c815780 (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
#! /bin/sh
# This script tests: pnmremap
# Also requires: pamdepth pamseq pamtopnm


tmpdir=${tmpdir:-/tmp}
palette=${tmpdir}/palette
palette255=${tmpdir}/palette255

pamseq 3 5 -tupletype=RGB | pamtopnm > ${palette}
pamdepth 255 ${palette} > ${palette255}

# Test 2. Default (unmodified quantization)
pnmremap -mapfile=${palette} -nofloyd \
testimg.ppm | cksum

# Test 3. Use first color in palette for missing colors
pnmremap -mapfile=${palette255} -nofloyd \
 -firstisdefault testimg.ppm | cksum

# Test 4. Use black for missing colors
pnmremap -mapfile=${palette255} -nofloyd \
-missingcolor=black testimg.ppm | cksum

rm ${palette} ${palette255}