Skip to content

Instantly share code, notes, and snippets.

@nickferrando
Last active May 11, 2020 14:37
Show Gist options
  • Save nickferrando/d02054f85c8a34194267452a82cd8407 to your computer and use it in GitHub Desktop.
Save nickferrando/d02054f85c8a34194267452a82cd8407 to your computer and use it in GitHub Desktop.
Proportional Resizing Overlays with ImageMagick
#!/bin/bash
#Make sure to replace "YOURPATH" with your logo/graphic overlay path, on line 5.
for f in *.png *.jpg
do magick $f -set option:sz "%[fx:min(w,h)*20/100]" \
\( YOURPATH -resize "%[sz]" \) \
-alpha on -channel rgba -gravity northeast \
-define compose:args=50,100 -composite $f
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment