Sunday, January 27, 2013

Digitising old negatives - Part 3 - processing

At the end of the last post I'd got a collection of digital images of colour negative film which I needed to turn into the digital equivalent of positive prints.  And I want to do it in a way that's as time-efficient as possible so I don't wish to have to work on each image individually unless it's to make some fine adjustment on a particularly valuable picture from the past.  Here's what I did:

Firstly, I took a sample of the images in JPG format and loaded them into the GIMP which is a free equivalent of Photoshop (If you have Photoshop, Lightroom or something like it, it will work just as well).  I then flipped the image vertically (In GIMP the menu steps are Image..Transform..Flip Vertically) and inverted the colours to turn the negative into a basic postive (Colors..Invert).  This gave me a somewhat washed-out looking image with a bluish tinge (because I hadn't completely eliminated the orange tint from the original negative; the remaining orange had been inverted to blue).

Using the Colors..Curves commands I played around with the curves for the different channels (reducing the blue, increasing the red, and changing from a straight line to more of an S-shape) until the colour tone of the picture looked right.  I then saved those curve settings as a preset and applied it to a few more images I had taken; if one didn't look right I'd change the settings, save again, and undo / reapply to the previous images until I had a set of curve adjustments that did a good job across a wide range of pictures.  Here, for reference, is what worked for me.


I also used the Levels tool to change the gamma setting from 1 to 1.5; this basically made the mid-tones of the images brighter which better reflected the prints I was comparing them to (although those prints were - I think - quite contrasty.  There's more shadow detail coming out of the digitised negatives than was ever on the prints).

These adjustments are all very well, but they would be time-consuming to apply (even with saved presets) to hundreds of images and the GIMP is only an 8-bit editing tool which means that some colour detail will be lost when using curves in this way.  The final step was to set up a way of adjusting the 16-bit RAW files from my camera, with as little human intervention as possible.

I did this using a free command-line tool called ImageMagick (IM).  IM has a lot of good ways of adjusting pictures, but one of the most useful for this job is something called Hald-Clut.  The idea is that you generate an image with all possible colours in it, apply whatever colour adjustments you like to that image, and can then use that image as a means to apply to same adjustments to any other images you wish to process.

The first step is to get IM to generate the Hald image by using the Windows command prompt and entering

convert hald:8 hald.png

Then use GIMP (or equivalent) to make the same adjustments (except the flip) to hald.png as you made to the negatives ie invert the colours, apply the curves and the gamma; and save the result as a .png file.  Although the hald.png file only has an 8-bit colour depth, IM will do some interpolation when processing 16-bit images against a Hald image to retain 16 bits of colour detail.

I then created a file called conv.bat (downloadable here, but you'll need to rename the extension from .txt to .bat - Google won't allow me to upload it with the right extension) with the following single line of text

for %%n in (*.tif) do convert %%n -flip hald.png -hald-clut -quality 97 %%~nn.jpg

which means "for each file with a .tif extension, use IM to firstly flip the file along its vertical axis, then apply the colour adjustments "encoded" in hald.png, finally save the result as a JPG file with quality setting 97.


Thereafter, it's a two stage process with all of your images.  Firstly convert the RAW files from your camera into 16-bit TIFF images, applying your favourite noise reduction software (I used Sony's Image Data Lightbox software for this, it came with my camera and will happily do a batch in one go).  Although IM will read RAW files directly, the Sony software is better at applying noise reduction than IM.  I set it to only apply noise reduction, not to try any other enhancements (white balance, exposure compensation etc.).

I copied the conv.bat file to the folder containing both the TIFF images and the hald.png file (you can download mine here), double-clicked on it to run, and it set of happily converting. Each file only takes a few seconds and the results (based on the negatives I've converted so far) are pretty consistent.

No comments: