#!/bin/bash INPUTDIR=o/png_lynx OUTPUTDIR=i/pdf_lynx TMPDIR=tmp LIST=pdf.list COUNT=0 # FIND FILES IN A DIRECTORY find ${INPUTDIR} -name "*.png" | sort > $LIST for PNG in `cat $LIST` do COUNT=`expr $COUNT + 1` IMAGENAME=`basename $PNG` # convert $PNG \ # -colors 2 -monochrome -negate -contrast-stretch 0%x50% -resize 400% -shave 320x200 \ # $OUTPUTDIR/`echo ${IMAGENAME%.*} | sed 's/\./___/g'`.pdf convert $PNG \ -negate -contrast-stretch 0%x50% -resize 400% -shave 320x200 \ $OUTPUTDIR/`echo ${IMAGENAME%.*} | sed 's/\./___/g'`.pdf # convert $OUTPUTDIR/$COUNT.pdf -negate $OUTPUTDIR/$COUNT_neg.pdf # convert -monochrome $PNG $OUTPUTDIR/$COUNT.pdf # convert -monochrome $PNG $TMPDIR/tmp.png # autotrace -centerline $TMPDIR/tmp.png --output-file=$OUTPUTDIR/$COUNT.pdf echo $COUNT done # rm -rf tmp/* exit 0;