Friday, January 1, 2016

Dodging and burning, Tux style

Today I'm going to take a departure from my usual artsy-fartsy meanderings to focus on something a bit more dry, but nonetheless extremely important: how to produce striking online images from your black and white negatives.

There are two very common problems I see again and again in viewing web images made from scans of black and white film.
1. Lack of local contrast
2. Lack of sharpness

I was quite guilty of falling prey to both of these when I first started experimenting in the digital darkroom. Because of this, I feel a burning desire to educate the general photographic public on these matters and make sure others don't make the same mistakes I did.

I suppose you might now be thinking that I should have more important things to worry about. Well, I wish I could say that you are mistaken, but I would be lying if I did. Such is my sickness.

For the last 5 years or so, I have been, and continue to be, a very strong advocate of the Linux operating system. I won't bore you with all of my reasons for this... but let's just say that neither of the other alternatives meet my personal targets for quality and performance (think Microsoft) or cost (think Apple). Over the past year I've come to prefer Ubuntu as my distribution of choice. I'm extremely pleased at the strides Linux has made over the past few years in improving usability for desktop users like myself.

Having already made my firm decision to embrace the penguin, by the time I became interested in serious film photography I had to accept the fact that this somewhat limited my choice of scanning and image editing software, at least if I didn't want to go the route of an emulator like Wine, or its commercial offshoot CrossOver.

Luckily, a fine gentlemen named Ed Hamrick sells, at an extremely reasonable cost, a superb cross-platform commercial scanning program known as VueScan. I cannot recommend this program enough, particularly if you are a Linux user. It couldn't be easier to use and supports a staggering list of scanners, including my ancient but trusty Minolta Scan Speed. Ancient really isn't much of an exaggeration. It actually has a SCSI interface. If you aren't old enough to remember SCSI, my point is already made.

For image editing, I use GIMP, the defacto open source Linux solution. (There are also commercial cross platform programs such as Bibble that are probably worth exploring). GIMP has its limitations, but my needs are relatively modest and, for the most part, GIMP has been able to satisfy them.

Now that I've gotten all the preliminaries out of the way, let's get down to business. For black and white negatives, I personally have achieved the best results by scanning the negative as a positive and then inverting later in GIMP. I set Media Type to "Image" and Bits per pixel to "16 bit Gray". Scan resolution should (obviously) be set to the maximum that your scanner affords, which in the case of my geriatric Minolta, is a mere 2820 dpi. Although low by today's standards, it still produces what is roughly the equivalent of a 10 megapixel digital capture.

Probably the most important step in scanning is to make sure your exposure setting is not causing loss of detail in shadows or highlights. Black and white film does a superb job of compressing the dynamic range of a scene, so in practice I haven't found this to be a problem unless the scanner exposure setting is way off. Nevertheless, I always tweak the automatic exposure value determined during the preview scan, based purely on my experience as to what works for a given negative's density and contrast. Until you have a good feel for this, I would recommend looking at the histogram in the scanning software to verify there is no clipping.

I save my scans as JPG with a quality setting of 95. This is such a minimal amount of compression that I have yet to see the benefit of saving uncompressed TIFF files. Perhaps if my scanner was sharper or had higher resolution it would be a different story, but for now these settings have worked quite well.

Here is what I will see in GIMP upon opening the JPG for the raw scan. The negative I selected for our example was chosen based on the fact that it is fairly contrasty, not for artistic reasons.


I first crop the extraneous border from the image and invert it. I then sharpen it ever so slightly to compensate for scanner limitations. For my Scan Speed I typically I use an Unsharp Mask with a radius of 1.0 and amount of 0.60 (a flatbed scan requires much more aggressive sharpening). When a scan should be sharpened seems to be a hotly debated topic. One philosophy says that it should be the final step in editing the image. The other view is that it should be first. In my case, the amount of sharpening is so mild that it probably doesn't matter, but in a sense I am in both camps because I also do perform a final sharpening, at least for images that are being resized for web presentation. More on that later.

After inverting, cropping and sharpening, I have this.


Next, I do an initial levels adjustment to boost the contrast and adjust the overall brightness. I am careful during this step to not significantly clip any highlights or shadows.




I should note that the previous step is where most neophytes go wrong. If one is to stop here, highlight and shadow details are preserved but the overall contrast is insufficient and the image looks flat. Essentially what we have here is the digital equivalent of a darkroom work print. If a more aggressive contrast boost is used so that the midtones look appropriate, the shadows are pure black and the highlights blown to scalding white nothingness.

Enter dodging and burning, digital style. Just as traditional darkroom printers selectively hold back (dodge) or give extra (burn) exposure to selected areas of a print, digital editing affords a more flexible (not to mention undoable) approach that doesn't take years of practice to master.

Before we proceed further, I should give the disclaimer that my technique is just one of many that can be used to retain shadow and highlight detail while boosting midtone contrast. I have been told that commercial programs like Photoshop and Lightroom have more advanced tools that can accomplish the same thing in much a simpler fashion. I don't doubt this is the case. For GIMP, however, this is the best method I have come up with so far that affords the level of control I feel is necessary.

The basic idea of this dodging and burning technique is to use additional layers with masks to preserve highlight (or shadow) detail that would otherwise be lost during the contrast boost required for "punchy" midtones.

The first step is to create 2 duplicate layers of our existing "work" image. Our layers dialog will then appear like this.


Next, we apply a Threshold to the top layer. I use the black slider, and typically set it somewhere in the range from 130 - 245. Everything to the right of the slider will become pure white, which will end up being the part of the mask that preserves highlight detail for the layer in which it is used. Figuring out the right setting comes with experience and depends quite a bit on the contrast range of the negative.




Next, perform a Gaussian blur on this layer. Figuring out the correct Radius setting can be a bit tricky and depends on factors such as the pixel resolution of the image and the size of the areas which require dodging/burning. For my scans, which are approximately 3840x2560, I typically use a value in the range from 80 - 150. In this example, let's use a blur radius of 120, which results in the image below.


Next, copy the curent layer to the clipboard, add a layer mask to the middle layer and paste the clipboard contents into the middle layer's mask (not the layer itself). After performing the paste, it will appear as a floating selection in the layers dialog, but by anchoring this it will show up in the intended location. Our layers dialog now looks like this.


Now it's time to boost the contrast of our bottom layer. Using Levels, we drag the right slider over and decrease the gamma (move the middle slider to the right) to give our midtones some snap.


To better demonstrate where we are at, first take a look at our bottom layer with the upper layer's visibility turned off. After performing the previous levels adjustment, you can see that the overall contrast is much higher. However, there is some loss of detail in the highlights, in particular the upper left portion of the frame.


Now, let's make the upper layer visible again. See the difference? The overall image is quite a bit flatter, and the highlights have an odd compressed look, but the shadows and midtones have a bit more contrast than the original "work" image.


We will now decrease the opacity of the upper layer to strike a balance between the two layers. The idea here is to adjust the highlights to give just the right amount of "heat". Here, a setting of about 73 was used.


At this point, we are making progress but the image still looks too flat. Normally I would make a new layer from visible and repeat the above process of duplicating, applying the threshold, blurring, creating the layer mask, etc. But in this case the problem highlight areas are pretty much confined to the top of the board in the upper left of the frame, so we can take a bit of a shortcut.

First, we select New from Visible in the Layers menu.


Then, we again peform a levels adjustment. This time, the goal is to build contrast without worrying about the highlights (we'll fix those shortly).




Our result has adequate local contrast, but as expected, we've lost the highlights on that troublesome board again. This is where our lower layers from earlier come back into play. We are going to burn back in the highlight detail we just lost.

Add a white layer mask to the top layer.


Next, make sure the foreground color is black. Select a fuzzy brush of an appropriate size for the highlight area. Here I've set the brush Scale to about 7.6. I've also adjusted the opacity to 80. This adjustment has a pretty dramatic effect and figuring out where to set it is a matter of trial and error. In general, the more loss in highlight detail, the higher the setting.


Making sure that the upper layer's mask is selected (not the layer itself), use the brush tool to "paint" in the highlights. Here I have managed to restore the lost highlights from the last levels adjustment.


Create yet another layer from visible.


It's now time for a final brightness/contrast adjustment. Here I've tweaked the levels to darken the image slightly and add just a bit more contrast.




At this point you will want to save off your work. By saving in the native GIMP XCF format, you will have access to all your existing layers and masks next time you reopen the project.

Remember back at the beginning of this post when I mentioned the second problem we would be discussing? Something it took me a while to figure out (I'm not the brightest guy around) is that the process you use to resize your images for the web has a very significant effect on the apparent sharpness of the final image.

I have found that for my 35mm scans I obtain the best results by performing a 2-stage resize using the Cubic interpolation setting. Interestingly, when I scan medium format negatives on a flatbed, I tend to get better results doing a single resize operation with Sinc (Lanczos 3) interpolation selected. Experimentation is important, because the original and target image sizes seem to have a lot to do with the method that gives the best apparent sharpness.

In this case, my original is roughly 3800 pixels wide and I would like to resize it to 950 pixels wide. So for my first resize operation, I meet somewhere in the middle, which is approximately 1900 pixels.




My second resize step takes it down to the final width of 950.


Despite the fact that this method gives me what I feel is a sharp final image, I still usually apply a very subtle unsharp mask. Typically I use a radius of 0.1 and amount of 0.20. An optional final step is to add a thin black border. GIMP has a built-in plugin for this under Filter -> Decor -> Add Border.

Voila! Our final image. Click below to see full size. Notice the sharp appearance of the grain. Considering that this is Tri-X developed in Rodinal, it should be grainy and if it isn't, there's an issue with my digital workflow.


At this point, I flatten the image and save it as a JPG. This becomes the web version. Be careful not to resave it as an XCF or you might accidentally overwrite your work from earlier.

Even if you forget everything you read above, remember these two points and you'll be well on your way to black and white bliss.
1. Nearly every scan will require at least some dodging/burning.
2. Exercise care during resizing your image.

Well, I realize this was a lengthy post, but if you've made it this far, hopefully you've picked up something of value. If not, well I don't feel sorry for you because I warned you that I'm not that smart.

-DG