Last active
May 5, 2020 22:51
-
-
Save dcrck/955cd887ca86264c293086da83be717d to your computer and use it in GitHub Desktop.
Watermarking for my photos. Run like `./watermark.sh input_file.jpg`, which produces `input_file_wm.jpg`
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 | |
if [ "$1" != "" ]; then | |
dr=$(dirname $1) | |
scdr=$(dirname $0) | |
fn=$(basename $1) | |
filename="${fn%%.*}" | |
extension="${fn#*.}" | |
output="${dr}/${filename}_wm.${extension}" | |
# wm.png is my watermark. It's a white logo with 50% opacity and a transparent background. | |
wm="${scdr}/wm.png" | |
echo Generating watermarked version of $1 under $output... | |
composite -dissolve 100 -gravity southwest $wm $1 $output | |
echo ...Complete | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment