Last active
August 15, 2018 03:59
-
-
Save zhigang1992/e84e162e5bbfa641eb013bccd35692c5 to your computer and use it in GitHub Desktop.
Watermarking folders of images. imagemagick required
This file contains 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 | |
# Put your files in origin folder | |
cd `dirname $0` | |
mkdir -p watermarked/origin | |
find origin -type d > watermarked/.dirs.txt | |
pushd watermarked | |
cat .dirs.txt | sed 's/.*/"&"/' | xargs mkdir -p | |
rm .dirs.txt | |
popd | |
find origin -type f \( -name "*.jpg" -or -name "*.png" -or -name "*.jpeg" \) -exec composite -tile watermark.png "{}" "watermarked/{}" \; | |
mv watermarked/origin/* watermarked/ | |
rm -r watermarked/origin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment