Saturday, 3 August 2024

Making a contact sheet

Up at the Athenaeum, Donna, one of my colleagues asked me if I knew how to make a contact sheet on Windows.

I didn't, and googling didn't help as everyone assumed that you had PhotoShop.

Well, we're a voluntary organisation and we fund everything out of our own money - yes there's some grant funding, that's paid for some things, and a photocopier cum printer cum scanner as funding in kind by the local council, but computers, software and the like we pay for ourselves.


computer generated contact sheet produced by yours truly

But when I got home, I thought, maybe I can do this on Linux.

So what's a contact sheet?

Well, in the old days of 35mm photography, often you would cut up your negatives into strips of four or five images, lay them out on a sheet of photographic paper and make a print showing the images in minature - a contact sheet as in this one from wikipedia


You would then look at the images through a magnifying glass and choose which one to print - in movies about journalists in the twentieth century there's often a scene where they squint at a contact sheet to find the image showing the bad person handing a bribe to the corrupt person after they've been on a stake out.

When everything went digital contact sheets disappeared - much easier to flick through the pictures using an image viewer.

So why a contact sheet?

Well, we have a large number of digitised images, and the idea was to group the images together, and put the contact sheets in a binder to let visitors - often family history researchers - look through to see which images we have and request copies.

As everything is done for 23c and stick of chewing gum and we don't have everything online or a front end to let people search, this struck us as a simple lowest common denominator solution.

So when I got home, I did a little digging and found that the montage command in Image Magick would do the trick. 

Put the images in a directory and run something like

montage *.JPG -label '%f' -background 'gray' -fill 'white' -geometry 450x450+2+2 -tile 4x6 ~/Documents/contact.png

to generate a suitable image like the one at the top of this blog post.

Now, obviously Donna is not going to go out and install Linux on a pc just to do this.

However, Image Magick also has a set of Windows binaries, so the next stage was to install them on my work machine.

The tools are all command line based so running the command from a scratch directory

C:\somehwere\scratch> magick montage *.JPG -label '%f' -geometry 450x450+2+2 -tile 4x6 contact.png


produces a very similar image to my original Linux experiment

There's only one thing I havn't got quite right the -label argument isn't adding the filename as I thought it would. As I don't get an error message I'm guessing I've misunderstood something, and I need to populate the filename list somehow ...

[Update 04/08/2024]

Facepalm moment! I was being too clever, montage not only wanted the filenames (not the filenames including the full paths to the locations) and the filenames need to follow the -label directive,  so the command that works is actually

C:\somehwere\scratch> magick montage -label '%f' *.JPG -geometry 450x450+2+2 -frame 10 -tile 4x6 contact.png

which provides an image like this



simple once you know how!



No comments: