» Menu
» My latest @ Flickr
Aurora Borealis - Tampere, Finland 2013-03-17 20130304-1705-DSC_3810 [Browse]
» My latest @ YouTube
» Links

Watermarking Scripts

If you need to add a watermark to a bunch of photos, these little scripts come in handy. You"ll need a command line tool from ImageMagick called composite.

You"ll need a watermark image somewhere, eg. C:\watermark.png or ~/watermark.png (/home/user/watermark.png) for Linux. Change the full path to the appropriate place if needed. You can also change the prefix (w_ by default) for the watermarked images. The script goes through all the JPG files in the directory that is given as a parameter and adds the watermark image to the location given and with an opacity of 45%.

For Windows, put it in a file like add_watermark.bat.
add_watermark.bat "C:\location_to_photos\"

@echo off

set wm_image=C:\watermark.png
set out_prefix=w_
set wm_location=southeast

set input_directory=%1
cd /d %input_directory%

for /f %%a in ("dir /b *.jpg") do call :ADDSTAMP %%a
goto :eof

set file=%1
echo Making watermarked image %out_prefix%%file% from %file%
composite -dissolve 45 -gravity %wm_location% %wm_image% %file% %out_prefix%%file%

For Linux, put it in a file like add_watermark.sh.
./add_watermark.sh /home/user/location_to_photos/



cd $input_directory

for file in *.jpg
 echo Making watermarked image $out_prefix$file from $file
 composite -dissolve 45 -gravity $wm_location $wm_image $file $out_prefix$file

The output on both should be something like this:
Making watermarked image w_image1.jpg from image1.jpg
Making watermarked image w_image2.jpg from image2.jpg

Usage on your own risk, I don"t provide any support for these. I just made them for my own use and they work for me.