From: Dan White Date: Sun, 3 Sep 2023 03:28:39 +0000 (-0500) Subject: scan2pdf: resolution option X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=7fa4c5e5702d895c637fd9b64a434303a3c1eaf0;p=pubbin.git scan2pdf: resolution option --- diff --git a/scan2pdf b/scan2pdf index 56b2532..908a722 100755 --- a/scan2pdf +++ b/scan2pdf @@ -8,6 +8,12 @@ if [ "$1" == "-h" -o "$1" == "--help" ]; then exit 1 fi +RESOLUTION="400" +if [ "$1" == "-r" ]; then + RESOLUTION="$2" + shift 2 +fi + INFILE="$1" OUTFILE="$2" @@ -33,14 +39,29 @@ fi #-compress zip \ #"$OUTFILE" + +#convert \ +# -density 400 \ +# "$INFILE" \ +# +dither \ +# -colors 32 \ +# -black-threshold 60% \ +# -fuzz 40% -fill white -opaque white \ +# -extent 3400x4400 \ +# -compress zip \ +# "$OUTFILE" + +echo "dpi: $RESOLUTION" +echo "geom: $((RESOLUTION * 17/2))x$((RESOLUTION * 11))" + convert \ - -density 400 \ + -density "$RESOLUTION" \ "$INFILE" \ +dither \ -colors 32 \ -black-threshold 60% \ - -fuzz 40% -fill white -opaque white \ - -extent 3400x4400 \ + -fuzz 20% -fill white -opaque white \ + -extent "$((RESOLUTION * 17/2))x$((RESOLUTION * 11))" \ -compress zip \ "$OUTFILE"