#!/bin/sh
# $Id$
# convert XPM files to XPM3 format and increase contrast for PostScript usage

files="$@";
if [ $# = 0 ]; then
  files="ddd-*.xpm"
fi

for file in $files; do
  echo -n "$file: "
  sed 's/ gray90/ white/
  s/ grey90/ white/
  s/ #e.e.e./ white/
  s/ #f.f.f./ white/' $file | sxpm -nod -o $file@
  if [ -f $file@ ]; then
    if cmp $file@ $file; then
      echo unchanged.
      rm $file@
    else
      mv $file $file~
      mv $file@ $file
    fi
  fi
done
