#!/bin/sh

if [ $# != 1 ] ; then
	echo "Usage: $0 <image>"
	exit
fi

# first convert to XPM which is a text format

EXT=`echo $1 | sed 's/.*\.\([^.]\+\)$/\1/'`
TMP=`mktemp`.xpm
convert $1 $TMP
sed -i 's/"   c black",/"   c None",/' $TMP
convert $TMP `basename $1 .$EXT`_trans.png
rm $TMP
