Skip to content

Instantly share code, notes, and snippets.

@AndrewReitz
Last active January 2, 2016 07:29
Show Gist options
  • Save AndrewReitz/8270238 to your computer and use it in GitHub Desktop.
Save AndrewReitz/8270238 to your computer and use it in GitHub Desktop.
Quick and dirty way to add a water mark to all images in a folder.
#!/bin/bash
WATERMARK="$1" #1st param image to be the water mark
#2nd param is path to folder you want all jpg, jpeg or png to
#have the water mark added to
for image in $2/*{.jpg,.jpeg,.png}
do
#gravity is the position the water mark will go
#50 is the opacity of the image
#the second $image is the output file, currently
#this will overwrite the input file, feel free to change to something else
#or place in a different directory
composite -gravity southeast -dissolve 50 $WATERMARK "$image" "$image" &> /dev/null
done
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment