#!/bin/sh # This short little GIF palette to GIMP palette translator script needs a # little utility known as "giftrans", which can be found at # http://ion.le.ac.uk/~mar5/giftrans.html # If you're using Debian, it's only an apt-get install away. # # This script (however hokey it may be), is covered under the GPL v2 # Located at: http://www.gnu.org/copyleft/gpl.html # # PS: It works, amazingly enough! (And, yes, I know the header is larger than # the sum of the script. *grin* giftrans -l $1 -e .palette.tmp; ( sed -e "s/Global Color Table:/GIMP Palette/" .palette.tmp |\ cut -f2 -d: | sed "s/ Red //" | sed "s/, Green//g" |\ sed "s/, Blue//g" | sed "s/,//g" |\ sort -n | uniq \ ) > `basename $1 gif`palette; rm -f .palette.tmp