Archive for January, 2008

FlickrTouchr.py – keep your flickr album and favourites on an iPod Touch or iPhone

Posted on January 21, 2008, under general, photography.

One of the great things I really like about the iPod touch is that it makes an excellent portable viewer for photos. In return for sacrificing 1GB of potential music storage, I get about 2,000 browseable, zoomable photos onto something that’s always in my pocket. Cool!

Flickr sets on an Ipod     Flickr favourites on an Ipod

To make the process easier, here’s a python script to synchronise the photos on an ipod from a flickr account. It’s at http://www.stdlib.net/~colmmacc/flickrtouchr.py.txt. It should run on any *nix platform (personally I’m running it on a Mac) and there’s some kind of a chance it might even work on Windows (but who knows).

The whole thing is a single python file, as implementing the flickr API calls myself rather than use any of various python flickr libraries (as they each seem poorly maintained) seemed easier. One of the reasons I’m even putting it online is that beyond anything else, it may be useful as an example of a truly minimal python implementation with the flickr API.

You run the script like so;

    flickrtouchr directory-name

and after it asks you to authenticate against your flickr account, it will progress through syncing your entire flickr account into a directory hierarchy. It keeps a small cache of authentication data in the directory too. It will be organised like;

    directory-name/set-name/[photos]
    directory-name/other-set-name/[photos]
    directory-name/No Set/[photos]
    directory-name/Favourites/[photos]

If you have the same photo in multiple sets it will use hard-links to preserve local disk-space. It also only downloads the most optimal version of the photograph available for the iPod touch/iPhone screen. Everytime you run it, it downloads the missing photos and new sets. Once you configure iTunes to synchronise photos from a folder, rather than iPhoto, it works great.

iTunes syncing from a folder

Of course it will work with any other device or software that takes photo from a hierarchy of folders. Happy flickring.

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

Conehead

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!

Mini-review: Sigma 10-20mm f/4 DC

Posted on January 3, 2008, under general, photography.

So, now that I’m back writing these things, there are two reviews to be done, and where better to start than with the Sigma 10-20mm f/4 DC I got way back in August.

Orly from heaven

The 10-20mm is an ultra-wide-angle for small-frame Digital cameras, giving about the same field of view as a 16-32mm would conventionally. Typical uses of this range are for architectural and landscape photography along with gritty street photography and photojournalism. Over at InPhotos this lens seems to be Donncha’s favourite, and there’s a ton of examples you can oogle at.

My experience with the 10-20 has been more of a mixed bag. I’m glad I bought the lens, and it lived in my camera bag until I upgraded to a larger format camera, but I didn’t use it as frequently as I had hoped (mainly due to travel).

Hoogslandse Kerk Leiden Everyone at the Tapas bar
Orly, choosing Irish Hunger memorial

First off, the lens does an excellent job of architectural photography. If you need to take a picture of a tall or wide building, and there’s not much going on, it can do a great job. If you take the time to learn how to get a decent exposure, it can do an amazing job of capturing rich tones and textures. I was pleasantly surprised by just how much detail came out in the photo of Hoogslandse church above, including details inside the building.

But when it comes to street photography, or people, the lens isn’t quite as versatile as I’d hoped. It’s not so much the lense’s fault as a problem with the format in general. The lens is so wide, and the sensor so small that this leads to two problems.

Firstly there is quite noticeable distortion and barrelling. Objects and people can take on a very wooden and 2 dimensional look. Very little of the depth comes across from the stones behind Orla, in the lead photo of this article, for example. And if you look at the plate of crackers on the table at the restaurant it’s positively oval (in reality, it was round, the distortion is particularly harsh at the edges).

Although a wide-angle lens is certainly not a portrait lens, the distortion means that when you want to shoot a subject, they are going to have to be at or near the centre of frame, which is pretty restricting in terms of composition. This is pure physics, and there’s nothing Sigma can do about it, it takes that short a focal length to get a wide viewing area on a small-frame camera. But it’s worth keeping in mind if the main purpose is for indoor use.

Grande Arche

The second problem is that because the viewing area is so wide, the camera’s metering system (and you!) has to do a lot of work. There can be huge degrees of variation in the exposure levels across the shot. Notice the over-exposed sky in the lead shot, or Simon’s white shirt in the group shot at the tables. Again, this is physics, there’s nothing Sigma can do about it, but it is worth keeping in mind that learning how to expose properly, having a 9-point (or more) in-camera metering system or getting a hand-held meter will be what makes the real difference with this lens.

Off the cuff and photo-journalistic shots will tend to have some of the scene blown out and overexposed. That’s not always a bad thing, it’s a valid and distinctive look (most of Donncha’s photos are shot like this), but if you prefer a more naturalistic capture it might be worth thinking about it.

Since I upgraded to a full-frame camera, I’ve sold this lens to Colin, who’ll make good use of it, but it definitely made a useful part of my collection while it lasted. It wasn’t anything like the lens I used most frequently, and it wouldn’t be at the top of my shopping list if I was building a new set. As a wide-angle for a digital SLR, it is very good – and presently has no competition, and if you know how to use a metering system it will reward you with excellent photographs.