#!/bin/sh - # # xpm2xbm files... # # This uses the pbmplus package to convert the xpm files to xbm format # # Anthony Thyssen 20 Dec 1993 anthony@cit.gu.edu.au # if [ "X$1" = "X-dither" ]; then dither=true shift fi for i in "$@" ; do if [ -f $i ]; then echo "converting \"$i\"" name="`basename $i`" name="`expr "$name" : '\([^.]*\)'`" j=`basename $i .xpm` if [ "$dither" ]; then sed -f $HOME/bin/bmaps/x2p.sed "$i" | xpmtoppm |\ ppmtopgm | pgmnorm 2>/dev/null | pgmtopbm -fs |\ pbmtoxbm | sed 's/static *char/static unsigned char/; s/noname\([[_]\)/'"$name"'\1/' > $j.xbm else sed -f $HOME/bin/bmaps/x2p.sed "$i" | xpmtoppm |\ ppmtopgm | pgmtopbm -threshold |\ pbmtoxbm | sed 's/static *char/static unsigned char/; s/noname\([[_]\)/'"$name"'\1/' > $j.xbm fi fi done