#!/bin/sh if [ $# -lt 2 ]; then echo "usage: quant xpmfile colors" >&2 exit 1 fi xpmtoppm $1 | ppmquant $2 | ppmtoxpm >${1%.xpm}.quant.xpm .