#! /bin/csh -f # Last edited on 2008-10-11 11:28:30 by stolfi # Converts a linear-scale ppm file to a gamma-corrected GIF file # unsing the standard 6x6x6 colormap. # Program paths: set maplib = "${STOLFIHOME}/PUB/colormaps" set jsbin = "${STOLFIHOME}/bin/${PLATFORM}" set jslib = "${STOLFIHOME}/lib" foreach d ( "${STOLFIHOME}/pkg/netpbm-1mar1994-1/PUB/${PLATFORM}/bin" "/usr/bin" ) if ( -x $d/ppmtogif ) set pbmbin = "$d" end # Option parsing: set scriptname = "$0" set usagetail = "[ < ] INFILE.ppm > OUTFILE.gif " unset transparent source ${jslib}/linear-ppm-to-gif-options.csh if ( $#argv > 1 ) then echo "usage: ${usage}"; exit 1 endif ( ${getimg} $* ; yes ) \ | ${jsbin}/ppmvquant \ -fs -rgb \ -map ${maplib}/standard-6x6x6-colormap-${gammatag}.ppm \ | ${pbmbin}/pnmgamma ${gamma} \ | ${pbmbin}/ppmtogif ${giftropts} exit 0