Watermark image with ImageMagick



Published: 2019-10-06 11:03:13 +0000
Categories: BASH,

Language

BASH

Description

Watermarking images by hand is a pain, it's a lot easier to drop a bunch of images into a directory, and watermark them using imagemagick. This snippet details the command to use

Snippet

# If you don't already have one,
# You can generate a watermark file with
convert -size 300x50 xc:none -font Arial -pointsize 20 -gravity center -draw "fill white text 1,1 'Copyright B Tasker' text 0,0 'Copyright B Tasker' fill black text -1,-1 'Copyright B Tasker' " WATERMARK_FILE.png

# Burn the watermark into the image in the bottom right corner
composite -dissolve 90% -gravity south-east $WATERMARK $INPUT $OUTPUT

# Gravities:
#
# South: bottom of image
# South-West: bottom left
# West: Centre left
# North-West: top left
# North: top
# North-East: Top right
# East: Centre right
# South-East: bottom right

Usage Example

composite -dissolve 90% -gravity south-east watermark.png DSC0143.jpeg DSC0143_wm.jpg

Requires

Keywords

image, watermark, bash, shell, cli,

Latest Posts


Copyright © 2019 Ben Tasker | Sitemap | Privacy Policy
Available at snippets.bentasker.co.uk, yr4pnhounvdybotb.onion and snippets.6zdgh5a5e6zpchdz.onion