Skip to content

Instantly share code, notes, and snippets.

@jdeagle
Forked from dcrck/watermark.sh
Created May 5, 2020 22:51
Show Gist options
  • Save jdeagle/10c74e18a01c9dfbe5c98b49d44dc309 to your computer and use it in GitHub Desktop.
Save jdeagle/10c74e18a01c9dfbe5c98b49d44dc309 to your computer and use it in GitHub Desktop.

Revisions

  1. @dcrck dcrck revised this gist Apr 30, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion watermark.sh
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@ if [ "$1" != "" ]; then
    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.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
  2. @dcrck dcrck created this gist Apr 30, 2020.
    14 changes: 14 additions & 0 deletions watermark.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    #!/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