Skip to content

Instantly share code, notes, and snippets.

@ideadapt
Created August 19, 2018 20:41
Show Gist options
  • Save ideadapt/855b44ec14706e800855a6032625cc9d to your computer and use it in GitHub Desktop.
Save ideadapt/855b44ec14706e800855a6032625cc9d to your computer and use it in GitHub Desktop.
Watermarks all images selected in MacOS Finder application with a transparent logo overlay
#!/bin/bash
exec 2>&1
export PATH=/usr/local/bin:$PATH
for image in "$@"
do
if [ -s "$image" ]; then
filename=$(basename "$image")
dirname=$(dirname "$image")
mkdir -p "$dirname"/watermarked
output="${dirname}/watermarked/${filename}"
composite -dissolve 50% -gravity southwest -geometry +10+10 \
~/.watermark/logo_page_transparent.png "$image" "$output"
echo "watermarked $output"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment