Skip to content

Instantly share code, notes, and snippets.

@jsta
Last active October 1, 2020 20:03
Show Gist options
  • Save jsta/553692d56b94bcce310ba314b554fc74 to your computer and use it in GitHub Desktop.
Save jsta/553692d56b94bcce310ba314b554fc74 to your computer and use it in GitHub Desktop.
Preview the title page of a pdf paper with a torn edge using imagemagick
test.png: test.pdf
convert -density 300 $<[0] -crop 100x20% -background white -alpha remove -strip -quality 70 test.png
mv test-0.png test.png
rm test-*.png
convert test.png -alpha set -background black -fill white \
\( +clone -colorize 100 -gravity south -chop 0x6 -splice 0x6 \
-spread 20 -paint 8 +transparent white -blur 0x0.8 \) \
-background none -compose dstin -composite torn.png
@jsta
Copy link
Author

jsta commented Oct 1, 2020

make test.png

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