From e9fe6a064358c8d481d4bc97c66e45d24d1edaac Mon Sep 17 00:00:00 2001 From: Dan White Date: Tue, 21 Aug 2018 16:14:27 -0500 Subject: [PATCH] scan2pdf: reduce colors and enhance scanned documents --- scan2pdf | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 scan2pdf 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" + -- 2.25.1