HOWTO: Adding a signature/watermark overlay to Photographs using Open-Source software
Posted on January 20, 2008, under meta, photography.
Since launching the new photoblog over at all costs I’ve gotten a few questions about how to overlay a signature, and how I’m doing it.
I’m a command line type of person so much of the processing software for my photos is python scripts I’ve hacked together, but in this case it’s just some simple ImageMagick which you can do almost anywhere. ImageMagick is much better than using Python’s own Image Library (PIL) because it actually maintains the embedded colourspaces (PIL just strips them).
Step 1: Create the image
The first step is to actually write out the signature, and to take a photograph of it or scan it. I recommend writing it out as big as you can, with a thick marker, on white paper. If you’re taking a photo of it, try to light the paper evenly and take the photograph from directly atop the paper. Once you’ve got an image to start with, load it into the Gimp.

Step 2: Crop the image
Select what you want with rectangle select tool, and crop, using image -> crop to selection.

Step 3: Convert to 1-bit
We don’t want to worry about all of the various shades that are in the image, so we convert to a 1-bit image. Use Image -> Mode -> Indexed to convert.


Step 4: Convert to grayscale
Now that we’ve cheated and used 1-bit mode to quickly go black-and-white, we need to go back to greyscale mode so that we can use transparency and play with the brightness a little. it’s at Image -> Mode -> Greyscale.

Step 5: Invert the colours
Use Colors -> Invert to transform the image into white on black, which is much better for overlaying onto photographs generally.

Step 6: Add an alpha channel
Since we need the final result to contain transparency, we need to add an alpha channel. It’s at Layer -> Transparency -> Add Alpha Channel.

Step 7: Remove the background
Use the colour-select tool at Select -> by Color to highlight all of the black background, and then cut it out using ctrl-x (or edit -> cut).


Step 8: Tweak the signature image
Personally I found that using a pure white signature was too strong and distracting, so I lowered the brightness by about 30%.


Once you’re happy with the image, you need to have it as a PNG file, so that we keep the transparency information.
Step 9: Applying the signature to photos
ImageMagick makes this fairly easy, all that I use is:
convert -composite -gravity southeast original.jpg signature.png output.jpg
Where photo.jpg is the original jpg of the photograph, and output.jpg is where you want the result.
Step 10: Enjoy the results
13 Replies to "HOWTO: Adding a signature/watermark overlay to Photographs using Open-Source software"
colmmacc on January 21, 2008
Hi Patpro,
You can do anything you want to the original photo before or after overlaying the signature, ImageMagick’s composite mode won’t touch the quality or size ratio settings. Personally I prefer to modify those after adding the signature, for better compression – and reduce to a maximum width of 700 pixels or a maximum height of 600 pixels for display in the blog. Though I leave the originals on flickr untouched.
Donncha O Caoimh on January 21, 2008
Great explanation of the process! I’d like to document how I “sign” my images too, although it’s a little manual so far. I need to get dirty with script-fu and script it!
nico on July 22, 2008
hi, very nice tutorial, it helped me a lot
thanks a lot ;)
Yoknapatawpha on August 7, 2008
is there a batch command for doing this to entire directories?
Earl Netwal on November 2, 2008
I was impressed with the how too, but I a novice with
graphics. I have Gimp but don’t really know how to use it. The thing that puzzled me most was wondering what an Alpha Channel is.
nick on November 8, 2008
izit using the imagemagick to crop the image and then use GIMP to do the rest???
online contests on May 28, 2009
I am super impress by this too! My brother is an expert in graphics but he never taught me always
robis on June 5, 2009
hey! thanks for sharing! it really helped me :) do you know also how to do add this watermark in batch use with imagemagick? this is not working:
for i in *.jpg ; do convert “$i” -composite -gravity southeast /home/robis/Graphics/watermark.png “Output/$i” ; done
ebusinessuk on November 20, 2009
You have done yeoman service for graphic designers. I’ve yet to come across a single website detailing this, the way you have.
Brent on February 12, 2010
Thanks for the tut worked well for me :D.
typo3 templates on February 12, 2010
thanks for giving information about overlay of picture. I will try it.
iamronel on May 16, 2010
whatta awesome tutorial..thanks a lot..:)


patpro on January 21, 2008
with such a process, you don’t have any way to control the quality of the output, do you ? The original jpeg is compressed again, then its quality/size ratio is out of control.
I don’t embed signature on my photos, but if I would want to, I’d prefer adding a step in my workflow *before* exporting the final photos, so that I can have the best quality/size ratio.
But well, for signing an old bunch of photos, it’s a great hint ;)