You are here

Batch Image Watermark Script

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
Rate this item!

This post is a copy of my website post; Please see original blog post for any updates:

In short: This script allows you to add an image watermark to a directory of pictures!

Lets start (Linux users please adjust where necessary!)

1. Download my script, here’s a link.
2. Save this file to your GIMP install followed by \share\gimp\2.0\scripts. GIMP is often found under Program Files (for those Windows users like me). While you’re there, why not open up the file and take a look at my hard work and imagine the alcohol needed to fuel that.
3. I did not put time into writing a fancy interface. This script is best run from command line. For Windows users Start -> Run… -> Cmd (hit OK) will do the trick.
4. Type cd followed by your GIMP directory (i.e. cd “C:\Program Files\GIMP 2\bin”)

OK take a break for one second and see what my command lets you define:

Watermark Path – Path to a watermark in XCF (GIMP) format. Other formats may work as well.
Input files – Path to directory, followed by a wildcard search (i.e. *.jpg to target all jpg images to be watermarked).
Watermark Size – How big your watermark will be in accordance to the image. This is a percent but is entered as a decimal such as .05 (5%).
Watermark Padding – Each watermark will be padded from the corners of the image by a percentage (of the entire image) you define. This is a percent but is entered as a decimal as well.
Watermark Layer Mode – leave this as 0 (zero). higher numbers (i.e. 1,2,3…) will enable a different layer mode such as lighten/hard light/etc.
Position Number – My script allows for the watermark to be aligned in any corner, or the center. Acceptable values are 1,2,3,4,5.
Output Path – Where the watermarked images will be saved to.

Important notes:

-- Any paths defined should be enclosed in quotes. These quotes should be preceded by a backslash with no space. I.e. C:\Mike in the script would become \”c:\\mike\”. Any other backslashes MUST ALSO be preceded by a backslash (as seen between c: and mike).
--Output path must be a directory. Do not leave a trailing slash on this.

So. You want to run THIS!

gimp-2.8.exe -b "(migee-add-watermark watermark-path inputfiles watermark-size watermark-padding watermark-layer-mode position output-dir)"

By example:

This is what I had to do to run my script on a folder WatermarkTest in my desktop on every JPG, having the watermark sized 25% and padded 1% along with a layer effect (15) and centered (5). Outputted files went to the same directory (the script prefixes all file names).

gimp-2.8.exe -b "(migee-add-watermark \"C:\\Users\\Migee\\Desktop\\WatermarkTest\\watermark.xcf\" \"C:\\Users\\Migee\\Desktop\\WatermarkTest\\*.jpg\" .25 .01 15 5 \"C:\\Users\\Migee\\Desktop\\WatermarkTest\")"

Final Notes:

Windows users, typing these the commands into a text file with the extension .BAT will save time if you do this a lot. It’s not easy with all the double slashes and slashed file location quotes.

This has HARDLY been tested and was really just completed to see if I could do this or not. I did little testing aside from the few images and singular watermark I’ve been working with. Please post up any problems and I can see if I can make this script work better!

Batch Image Watermark3.97 KB
GIMP Version: 
Code License: 
Subscribe to Comments for "Batch Image Watermark Script"