Archive for 'photography'

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.

My Signature, on a photo

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.

1st step

Step 2: Crop the image

Select what you want with rectangle select tool, and crop, using image -> crop to selection.

2nd step

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.

3rd step
4th step

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.

5th step

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.

6th step

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.

7th step

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).

8th step

9th step

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%.

10th step

11th step

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


New Photoblog

Posted on January 13, 2008, under photography.

Although I’ve been updating this blog less frequently than I used to, I have been taking a lot of photographs over the last few months. Gradually I’m getting slightly more and more confident in the results, and I have enough of a buffer of publishable photographs that I’m finally ready to start blogging some properly.

So, to that end, I’ve kicked off a Photoblog over at all costs, and you can subscribe to the feed too.

The blog itself is a mix of a custom theme and plugin I’ve hacked away on, for WordPress, and some styling from the Juicy theme too. There’s also some python hackery behind the scenes to fetch the photos from flickr, tinker with the colour-spaces, overlay the signature and then output two named renderings.

The photos will continue to go up to flickr, and each entry includes a link to the flickr page, along with tags explaining what equipment was used to take the picture. Hopefully I’ll be blogging photos at the rate of about 3 a week, and getting better as I go!