#!/bin/csh

# I create the icons using xpaint, which doesn't handle transparent
# backgrounds.  So I flood the areas I want transparent with magenta and
# save it as an xpm, which happens to be an ascii format.  When I'm done,
# I use sed to convert the magenta areas to transparent ones.  Then I use
# convert (part of Image Magick, which does understand trasparency) to
# turn it into a gif, which more programs understand.  It sounds clumsy
# but it works for me, especially with the help of this script.  -dr

foreach a ($argv)
  sed 's/c #FFFF0000FFFF/c None/; s/c [Mm]agenta/c None/' $a > tmp$a
  set b = `echo $a:r.gif`
  convert tmp$a $b
  echo "$a => $b"
  rm tmp$a
end
