Skip to content

Instantly share code, notes, and snippets.

@nuex
Created October 20, 2016 03:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nuex/24ef96faed13a372d38b8483e616f871 to your computer and use it in GitHub Desktop.
Save nuex/24ef96faed13a372d38b8483e616f871 to your computer and use it in GitHub Desktop.
convert scanned docs to tiny pdfs
#!/bin/sh
outname="$1"; shift
target="${outname}.tif"
scanimage --format tiff --resolution 300 --mode Gray > "$target" && \
convert "$target" -colorspace gray -level 10%,90%,1 -blur 2 +dither -monochrome "${outname}_bw.tif" && \
tiff2pdf -o "${outname}.pdf" "${outname}_bw.tif"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment