Created
April 25, 2013 09:48
-
-
Save jaymzcd/5458693 to your computer and use it in GitHub Desktop.
Nice and easy watermarking with imagemagick on a directory with a given mask
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # _ _____ ________________ __ ______ ____ __ __ | |
| # | | / / |/_ __/ ____/ __ \/ |/ / | / __ \/ //_/ | |
| # | | /| / / /| | / / / __/ / /_/ / /|_/ / /| | / /_/ / ,< | |
| # | |/ |/ / ___ |/ / / /___/ _, _/ / / / ___ |/ _, _/ /| | | |
| # |__/|__/_/ |_/_/ /_____/_/ |_/_/ /_/_/ |_/_/ |_/_/ |_| | |
| OUTDIR=${3:-/tmp} | |
| MASK=${2:-mask.png} | |
| # Set field separtor to ignore spaces in files when expanding | |
| IFS=$(echo -en "\n\b"); | |
| echo "Using $MASK and outputing to $OUTDIR"; | |
| for file in $1/*; do | |
| echo "Watermarking $file"; | |
| composite -gravity center $MASK "$file" $OUTDIR/`basename $file`; | |
| done | |
| unset $IFS; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment