about summary refs log tree commit diff
path: root/test/pnmremap2.test
blob: f2fd92e0da9663575b615c9d7fcf8b9efa372170 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#! /bin/bash
# This script tests: pnmremap
# Also requires: pamdepth pamseq pamtopnm

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

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

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

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

rm ${tmpdir}/palette{,255}