Batch watermark problem

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
acrocephalus

Batch watermark problem

Post by acrocephalus »

Hello!
I'm trying to batch watermark a full directory of jpg images using this code:

Code: Select all

composite -gravity SouthEast -geometry +10+10 stamp.png *.jpg
but it does not work. In fact, it replaces the last image with the first (which it is watermarked!) Any idea on how to solve it?
Cheers!

Dani
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Batch watermark problem

Post by fmw42 »

Convert and composite do not allow working on a directory of images. see mogrify. But I am not sure mogrify will allow the composite. If not, then you likely will need to write a script to loop over your images.
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Re: Batch watermark problem

Post by el_supremo »

If you're using Windows, you can use this statement in a DOS window to process all JPG in a directory:

Code: Select all

for %F in (*.jpg) do composite -gravity SouthEast -geometry +10+10 stamp.png %F %F
If you want to do this in a batch file you must double the percent signs:

Code: Select all

for %%F in (*.jpg) do composite -gravity SouthEast -geometry +10+10 stamp.png %%F %%F
Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
Post Reply