Created
February 27, 2015 11:32
-
-
Save unimatrixZxero/bc9ea46e8ffef29794b1 to your computer and use it in GitHub Desktop.
Script that uses imagemagick to append a watermark to the bottom of each image in the given folder.
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/sh | |
# _ __ _ _____ | |
# __ ______ (_)___ ___ ____ _/ /______(_) _/__ / _ _____ _________ | |
# / / / / __ \/ / __ \__ \/ __ \/ __/ ___/ / |/_/ / / | |/_/ _ \/ ___/ __ \ | |
# / /_/ / / / / / / / / / / /_/ / /_/ / / /> < / /___> </ __/ / / /_/ / | |
# \__,_/_/ /_/_/_/ /_/ /_/\__,_/\__/_/ /_/_/|_| /____/_/|_|\___/_/ \____/ | |
# | |
# 2012-11-02 | |
# Script to use imagemagick to append a watermark to the bottom of a folder of images. | |
# | |
# Usage: | |
# | |
# Copy the watermark.jpg you want to use into the folder where the images are. | |
# - works best if the image has a white background as that will be the default | |
# imagemagick uses to fill in the void | |
# - it will skip the watermark.jpg and .dotfiles in the folder | |
# | |
# Example: | |
# %> cd where_my_pics_at | |
# %> append_watermark.sh . | |
PREFIX=${PREFIX:-'photography'} | |
for i in `find $1`; | |
do | |
new_name="${PREFIX}_`echo \"$i\" | sed -e 's/.jpg//' | sed -e 's/\.\///'`.jpg" | |
if [[ $i == ./.* ]] || [[ $i == *watermark* ]] || [[ $i == . ]] || [[ $i == *$PREFIX* ]]; then | |
echo "Skipping ${i}" | |
else | |
echo "Appending watermark to: ${i} -> ${new_name}" | |
convert -append "$i" watermark.jpg "$new_name" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment