From: Dan White Date: Tue, 21 Aug 2018 21:14:27 +0000 (-0500) Subject: scan2pdf: reduce colors and enhance scanned documents X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=e9fe6a064358c8d481d4bc97c66e45d24d1edaac;p=pubbin.git scan2pdf: reduce colors and enhance scanned documents --- diff --git a/scan2pdf b/scan2pdf new file mode 100755 index 0000000..37e3b3e --- /dev/null +++ b/scan2pdf @@ -0,0 +1,25 @@ +#!/bin/bash + +# ImageMagick utility to sharpen and reduce colors in scanned documents +# + +if [ "$1" == "-h" -o "$1" == "--help" ]; then + echo "usage: scan2pdf input.pdf output.pdf" + exit 1 +fi + +INFILE="$1" +OUTFILE="$2" + + +convert \ + -density 300 \ + "$INFILE" \ + +dither \ + -colors 64 \ + -black-threshold 50% \ + -fuzz 20% -fill white -opaque white \ + -extent 2550x3300 \ + -compress zip \ + "$OUTFILE" +