diff --git a/bin/post-scan b/bin/post-scan new file mode 100755 index 0000000..4416f9a --- /dev/null +++ b/bin/post-scan @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +# auto fix issues with my scanner +input="$3" +color=$(magick "$input" -format "%[hex:u.p{100,-1}]" info:) +tmp=$(mktemp --suffix=.png) +magick "$input" -page +0-100 -background \#$color -flatten -auto-level $tmp +magick $tmp -quality 100 "${input%.*}.pdf" +rm -rf $tmp "$input"