Skip to content

Instantly share code, notes, and snippets.

@shannietron
Created July 10, 2020 05:09
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 shannietron/35009f35fda1730b9ded96870386832d to your computer and use it in GitHub Desktop.
Save shannietron/35009f35fda1730b9ded96870386832d to your computer and use it in GitHub Desktop.
make your files look like they went through dead trees.
function makeScanned
convert -density 150 $argv[1] -colorspace gray -linear-stretch 3.5%x10% -blur 0x0.5 -attenuate 0.25 +noise Gaussian -rotate 0.5 temp.pdf
gs -dSAFER -dBATCH -dNOPAUSE -dNOCACHE -sDEVICE=pdfwrite -sColorConversionStrategy=LeaveColorUnchanged dAutoFilterColorImages=true -dAutoFilterGrayImages=true -dDownsampleMonoImages=true -dDownsampleGrayImages=true -dDownsampleColorImages=true -sOutputFile=output.pdf temp.pdf
end
#idea from this HN thread
#https://news.ycombinator.com/item?id=23160387
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment