X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=buildscripts%2Fps-to-gifs.sh;h=e2a3da89cb7b0451cd3d55a9610557f32bcfbc43;hb=52aa2e58ed0912a474c94284e5f7a1cc8f9b6612;hp=12ea5773394b804cd289b824d70f766026ea7835;hpb=b66b5013d3800245b2f185e2d86aa55a743cd8b5;p=lilypond.git diff --git a/buildscripts/ps-to-gifs.sh b/buildscripts/ps-to-gifs.sh old mode 100755 new mode 100644 index 12ea577339..e2a3da89cb --- a/buildscripts/ps-to-gifs.sh +++ b/buildscripts/ps-to-gifs.sh @@ -11,6 +11,7 @@ Options: -c, --crop crop output -o, --output=NAME set output base -p, --png convert to png + -s, --size=SIZE set papersize -t, --transparent change white to transparent EOF } @@ -45,6 +46,11 @@ shift GIF=png PNMTOGIF=pnmtopng ;; + -s) SIZE="-sPAPERSIZE=$2"; shift + ;; + --s*=*) + SIZE="-sPAPERSIZE=`echo $opt | sed -e s/"^.*="//`" + ;; -*) echo "ps-to-gifs: unknown option: \`$opt'" exit 1 @@ -68,14 +74,13 @@ fi # urg, pipe breaks rm -f $BASE{.ppm,.$GIF} $BASE-page*{.ppm,.$GIF} -# generate the pixmap at twice the size, then rescale (for antialiasing) -cat $FILE | gs -sDEVICE=ppmraw -sOutputFile="$BASE-page%d.ppm" -r200 -dNOPAUSE - -c quit $FILE +cat $FILE | gs -sDEVICE=pgm $SIZE -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sOutputFile="$BASE-page%d.ppm" -r90 -dNOPAUSE - -c quit $FILE # quant is soo slow # cat $PPMFILE | ppmquant 2 | pnmscale 0.3333 | pnmcrop | $PNMTOGIF $color > $OUTFILE PPMS=`ls $BASE*ppm` for i in $PPMS; do o=`dirname $i`/`basename $i .ppm`.$GIF - cat $i | pnmscale 0.5 | $CROP | $PNMTOGIF $color > $o + cat $i | $CROP | $PNMTOGIF $color > $o rm $i done