projects
/
pubbin.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6ec7b64
)
scan2pdf: reduce colors and enhance scanned documents
author
Dan White
<dan@whiteaudio.com>
Tue, 21 Aug 2018 21:14:27 +0000
(16:14 -0500)
committer
Dan White
<dan@whiteaudio.com>
Tue, 21 Aug 2018 21:14:27 +0000
(16:14 -0500)
scan2pdf
[new file with mode: 0755]
patch
|
blob
diff --git a/scan2pdf
b/scan2pdf
new file mode 100755
(executable)
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"
+