Original and converted files share the same prefix
(e.g. /x/y/abc.gif is converted to /x/y/abc.png)
#!/bin/sh
# ungif - convert gifs to PNG format
for f in $@
do
dir=`dirname "$f"`
prefix=`basename "$f" .gif`
outfile="$dir/$prefix.png"
giftopnm "$f" | pnmtopng > $outfile
done