Skip to content

Instantly share code, notes, and snippets.

@nilsandrey
Created March 17, 2023 17:05
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 nilsandrey/c91306b0206c783fb80905ca86910359 to your computer and use it in GitHub Desktop.
Save nilsandrey/c91306b0206c783fb80905ca86910359 to your computer and use it in GitHub Desktop.
Apply an "scanned" effect to a PDF. From https://news.ycombinator.com/item?id=35132018
#!/bin/sh
ROTATION=$(shuf -n 1 -e '-' '')$(shuf -n 1 -e $(seq 0.05 .5))
convert -density 150 $1 \
-linear-stretch '1.5%x2%' \
-rotate ${ROTATION} \
-attenuate '0.01' \
+noise Multiplicative \
-colorspace 'gray' $2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment