Skip to content

Instantly share code, notes, and snippets.

@coryodaniel
Forked from andyrbell/scanner.sh
Created March 10, 2020 03:32
Show Gist options
  • Save coryodaniel/02482c0a7885590ba82b698627fd2c97 to your computer and use it in GitHub Desktop.
Save coryodaniel/02482c0a7885590ba82b698627fd2c97 to your computer and use it in GitHub Desktop.
Make a pdf look scanned using ImageMagick
# use ImageMagick convert
# the order is important. the density argument applies to input.pdf and resize and rotate to output.pdf
convert -density 90 input.pdf -rotate 0.5 -attenuate 0.2 +noise Multiplicative -colorspace Gray output.pdf
@coryodaniel
Copy link
Author

convert -density 150 input.pdf -rotate "$([ $((RANDOM % 2)) -eq 1 ] && echo -)0.$(($RANDOM % 4 + 5))" -attenuate 0.4 +noise Multiplicative -attenuate 0.03 +noise Multiplicative -sharpen 0x1.0 -colorspace Gray output.pdf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment