A bash script to watermark all the images in a folder (ubuntu, imagemagick, svg)

Hello, this time something a bit “nerdy”, i need a script to watermark a batch of images, prior to upload them on Flickr, but all the scripts i’ve found, using ImageMagick, uses a fixed width image and watermark.

My idea is to automatically resize the watermark to about 50% the width of the image and the apply it.

This simple script just browse all the files in a folder, with a specific extension (ie *.jpeg, *.JPG, etc) and first read the width of the image, then resize the watermark to the correct size (50%) and then apply it, saving the new image with the same name but in a subfolder.

Please note, to work this scripts needs that you’ve installed ImageMagick and optionally Zenity and was tested with Ubuntu 11.04.

If you put this script in your home_folder/.gnome2/nautilus_scripts then you can access it just right-clicking inside the folder with your images and choosing the script in the “scripts” menu

5 pensieri su “A bash script to watermark all the images in a folder (ubuntu, imagemagick, svg)”

  1. Hey, great script but how about a little change: if the image is landscape apply watermark landscape.png and if image is portrait apply portrait.png?

    Is this possible? How would you do it?

    1. Hello Chad, to convert only newly added images you have to check which files are already into the “converted” folder or write somewhere (a temp file) once the files are converted. Both solutions goes beyond the idea of the script. Usually i create another folder, called “original”, where i move the original images once the watermarked are created…

Lascia un Commento, lo apprezzerò molto!