Skip to content
MagickCmd › ImageMagick watermark command generator

ImageMagick watermark command generator

Add a semi-transparent logo watermark with ImageMagick. Corner placement, opacity control, tiled watermarks across the whole image. Copy-paste ready commands.

Watermarking is the task that forces you to learn ImageMagick's most useful feature: the parenthesised sub-expression. Everything inside ( … ) applies to the watermark only, leaving the base photo untouched.

Semi-transparent logo in the corner

magick input.jpg \
  '(' logo.png -alpha set -channel A -evaluate multiply 0.4 +channel ')' \
  -gravity southeast -geometry +24+24 -composite output.jpg

Reading it left to right:

  • -alpha set makes sure the logo has an alpha channel — needed if it does not already have one.
  • -channel A -evaluate multiply 0.4 multiplies that channel by 0.4, giving 40% opacity.
  • +channel stops restricting to alpha. Forgetting this is a classic bug — every later operator would keep touching alpha alone.
  • -gravity southeast -geometry +24+24 places it 24px in from the bottom-right corner.

About the parentheses

The parentheses are ImageMagick syntax, not shell syntax, so your shell must not eat them. Quoting them as '(' and ')' works in bash, PowerShell and cmd alike — which is why the builder above emits them that way rather than the more common \( escape you will see in older tutorials.

Scale the watermark relative to the photo

A fixed-size logo looks wrong across images of different sizes. Scale it as a percentage of the source instead:

magick input.jpg \
  '(' logo.png -resize 20% -alpha set -channel A -evaluate multiply 0.45 +channel ')' \
  -gravity southeast -geometry +30+30 -composite output.jpg

Tiled watermark across the whole image

magick input.jpg \
  '(' logo.png -alpha set -channel A -evaluate multiply 0.15 +channel \
      -write mpr:tile +delete ')' \
  '(' +clone -alpha set -tile mpr:tile -draw 'color 0,0 reset' ')' \
  -compose over -composite output.jpg

mpr: is an in-memory register. The watermark is prepared once and stored, then a clone of the photo is painted entirely with that tile before being composited back on top. Keep the opacity low — 10 to 20% — or a tiled mark becomes unreadable noise.

Text instead of an image

If you only need a copyright line, skip the logo file entirely — see the add text page. The trick there is drawing the text twice, dark then light, so it stays legible over both a bright sky and a dark shadow.

Watermark a whole folder

mkdir -p out
for f in *.jpg; do
  magick "$f" '(' logo.png -alpha set -channel A -evaluate multiply 0.4 +channel ')' \
    -gravity southeast -geometry +24+24 -composite "out/$f"
done

A realistic note on what watermarks achieve

A corner watermark is trivially cropped off and a tiled one can be substantially removed by inpainting tools. Watermarks are useful for attribution and for discouraging casual reuse. They are not copy protection, and it is worth deciding which of those you actually need before degrading your images.


Related

Copied