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.

Saturday, January 26, 2013

Digitising old negatives - Part 2 - exposure

In my last post I described how I obtained and assembled a negative or slide copier that will work on a crop-sensor (APS-C) DSLR.  In this part I'll explain how to I got consistent results.  I was aiming for three things

  1. The slide had (obviously!) to be in focus
  2. Exposure had to be more or less correct
  3. Colour negatives have a strong orange tint.  I wanted to remove this as much as possible (I could have left it all to post-processing on the computer, but figured that the less drastic the adjustments I made in software, the better the overall quality would be).
Focusing was easy, because the M42 to Sony lens mount adapter I have has a "focus confirmation" chip, meaning that when you turn the focus ring on the lens a green dot will show up in the viewfinder when the image is sharply focussed.  This isn't usually perfect, but in this case it's good enough.  I set the aperture on my lens to its widest (lowest number - f/1.7), loaded a negative into the holder, pointed the camera at the light on the ceiling and adjusted the focus until the green dot appeared.  If your adapter or camera doesn't have the benefit of focus confirmation, or "live view" or equivalent, then you may have to find the best focus point by trial and error. Adding one or more extension tubes to a lens reduces the depth of field (range of distance for which an image is in focus) drastically so be prepared for some fine tuning.

To get a consistent exposure, I decided to use my flashgun.  This also meant I could compensate for the orange tint in the negatives by putting flash gels (tinted pieces of plastic) in front of the the flash.  I bought a few sets very cheaply from flashgels.co.uk and rather than buy a clip for them found it easiest simply to use the wide angle diffuser that came with my flash to hold them in place.  My flash (a Sony F42AM) can be triggered wirelessly by the camera but a cable-attached one would have worked too.





In order to get as sharp a picture as possible, I set the aperture on the lens down to f/8 (most lenses are at maximum sharpness around this point; the increased depth of field from a smaller aperture also meant it would matter less if the focus was slightly off).

I then experimented with various flash power settings and distances between the flash and the negative to get a reasonable exposure (one where the histogram displayed on the camera when reviewing pictures bulges more or less in the middle).  I found that setting my flash (which has a Guide Number of 42) on half power and placing it the length of a standard bic biro (14.5 cm) from the negative gave a good result.  The inverse square law applies here (light intensity falls off by a factor of four as the distance between flash and subject is doubled), so full power at about 20cm distance should give an equivalent exposure.

Because I'm using a fixed aperture and setting the flash power myself, shutter speed is more or less irrelevant but I put the camera into Manual mode and chose a shutter speed of 1/160.  A couple of minor camera settings which helped (again to ensure consistency between shots) - I set white balance to "flash" and the "DRO" optimiser off.  Finally I set the camera to save both RAW and JPG files; Part 3 explains why.

To work out which combination of gels to use, I put some an unexposed but developed part of a negative (from the start or end of the film) into the slide holder and took some shots, swapping various gels in and out, until the colour most closely resembled light grey; this took three Half-CTB (Lee filter 202) gels and one Quarter plus green (Lee 246) one.

My first few shots were spoiled by dust and dirt on the inside and outside of the diffuser glass at the end of the Accura; it's important to make sure that this - as well as the negative of course - is as clean as possible before shooting.  My negatives were in strips of four, and to start with I was lining them up through the camera viewfinder which was tedious as I had to open up the aperture so I could see enough to adjust the position of the negative, then close it down again (whilst remembering not to touch the focus ring) and of course ensure the camera was positioned correctly relative to the flash.  After a while I got a feel for where the negative should be (going by the positioning of the sprockets on either side) so was able to shoot, move to the next negative in the strip, shoot again, etc. reasonably quickly.  The results were decently sharp and exposed - how to process them into good positive pictures again?  That's the subject of Part 3.

One final point on the negatives - it's best to have the side with the film emulsion facing the camera which means the image will have to be "flipped" on its vertical axis later.  This means putting the negative into the holder (a) with the picture upside-down, and (b) with the lettering / numbers at the top of each frame showing back-to-front when looked at from behind the camera.

Digitising old negatives - Part 1 - kit

Over the past year or so I've been investigating how to transfer a set of old slides and negatives to the computer.  I was looking for a method that would provide reasonable quality, be fast, and fairly cheap.  And thanks to some information from herehere and here, I think I've found it.  (I'm very grateful to the authors of those articles for posting about their experiences, and it's in the same spirit that I've decided to document what I have done).

Although I have a scanner - one of those cheap HP all-in-one scanner / printer / copier devices - it isn't very good and scanning film is, by all accounts, a slow process.  Instead I looked into using a slide copier (sometimes called a slide duplicator), a piece of kit that was common a few decades ago.  Slide copiers are basically tubes with a lens inside, one end has a holder for slides (and often negatives), the other end screws into a compatible SLR camera body.  Most copiers used the M42 lens mount which meant that they were compatible with a wide range of cameras.  There was no need to set focus because the slide would always be a fixed distance from the camera. Secondhand copies are quite easy to find on ebay.  My Digital SLR, a Sony, can use M42 lenses with the help of a cheap adapter (most other brands of DSLR can too).  So why not go down this route?

The reason is that these copiers were designed to produce a 1:1 copy of the slide on the 35mm film of an old SLR.  Most Digital SLRs have a sensor - often called APS-C size - that's smaller than 35mm film; they aren't true "35mm" cameras at all.  Only "full frame" DSLRs have a sensor of the right size, and they are expensive (£2000 upwards at the time of writing).  I don't have one. The effect of using a slide copier on a camera with an APS-C sized sensor would be to crop the slide; the outer edges would not be copied (about a third of the total area).

Instead, I've opted for a different kind of duplicator that doesn't have its own lens and has some flexibility in its set-up, the Accura Variable Magnification Duplicator. This dates from the late 1960s / early 1970s and was also sold under the Miranda and Panagor names.  It is much rarer than the standard slide copiers but does turn up on ebay (usually from USA sellers) every few weeks.  It consists of a slide and negative holder which screws into a set of metal rings, the assembly then (possibly with the help of a filter ring step-up or step-down adapter) screws onto your camera lens.

My copy of the duplicator came with the holder, two rings labelled "6 Japan", an unlabelled one, and one with "49F7". The "6 Japan" rings screw into the slide copier itself; they are extension tubes with a diameter matching the old  "Cokin Series 6" (sometimes Roman numeral - VI is used) filter size.  The unlabelled ring is an adapter between this  and "Cokin Series 7" (or VII) size and the final ring is an adapter between Series 7 and a 49mm filter mount.  What this means in plain English is that by screwing all of these bits together in the correct order you can then screw the assembly onto a lens with a 49mm filter thread and - just as importantly - put a bit of distance between your lens and the slide holder.  If your lens has a different filter thread size (55mm is common), adapter rings to convert between the two are common on ebay or photography shops; if your lens filter is more than 49mm (and most will be) then you'll need to search for a step down filter ring of the correct size (xxmm to 49mm).

The set-up I have just described is how the Accura was originally meant to be used; the slide would be of more or less the right distance from the lens to ensure that the whole slide was captured when a lens of the standard 50mm focal length was used to photograph it.  There is an adjustment screw on the Accura which allows for fine-tuning of the distance; the manual that came with it suggests that using this adjustment you can compensate for your lens having a focal length of anything between 50 and 58mm.

However, using this arrangement with today's DSLRs (unless they are full-frame) leaves us with two major problems to solve (and a minor one concerning exposure which I'll cover later).

  • In order to capture the full slide (or negative) on an APS-C size DSLR sensor you either need a lens with a shorter focal length (around 35mm), or you need to put more distance between your lens and the slide holder
  • Unless you have a specialist macro lens to hand, it's unlikely that you will be able to focus on the negative - the distance between it and the lens will be too short for the lens' optics to cope
 Turning to the second problem first, the cheapest way to set up a close focusing lens was to use an old M42 manual focusing / aperture lens with an adapter for my DSLR and some extension tubes.  Extension tubes fit between the back of the lens and the adapter, and their effect is to dramatically shorten the minimum (and maximum) distance over which the lens will focus.  My M42 lens and extension tubes (which I already had - another reason for going down this route) cost around £20 in total and are widely available secondhand or on ebay.

My M42 lens had a 50mm focal length so I still needed to solve the first problem.  35mm M42 lenses are comparatively rare and expensive, and I was concerned that one might introduce a slight degree of "barrel distortion" on the final picture, so I chose to put more distance between the lens and the slide holder.  The easiest way to do this was to hit ebay (one last time) and buy a whole set of those filter step up / step down rings I mentioned earlier; for £10 (from a Chinese seller) I got a set that would adapt from 49mm all the way up to 82mm and back again.  All the rings screw together; by a bit of trial and error I found that I could achieve the right distance by putting the rings that went from 49mm to 62mm and back again between my lens filter thread and the "49F7" adapter.


The final piece of kit to add in was a flashgun - again I was able to make use of one I already owned.  Using that to control exposure will the the subject of Part 2 of this post.

I've described a set-up using a Sony DSLR and manual focus lens, but there's no reason why this shouldn't work for other DSLRs or even for compact digital cameras that take standard filter sizes on their lenses (or can fitted with an adapter to do so).  A native fitting macro lens of around 50mm focal length could be used (dispensing with the extension tubes); alternatively Canon, Nikon and Pentax DSLRs can use M42 lenses with an adapter.  The combination of Nikon and M42 isn't usually recommended because you can only achieve close focusing (ie not beyond a few metres) but since closer focusing is what we want for this exercise it shouldn't matter.