Linux Format

GIMP: HDR photograph­y

Mike Bedford investigat­es how to generate dramatic photos, containing much more of the tonal variation we actually see in a scene.

-

Mike Bedford investigat­es how to generate dramatic photos, containing much more of the tonal variation we actually see in a scene.

According to a large majority of digital camera users, the quality of photos depends on one thing and one thing only: resolution, in megapixels. If only things were that simple. In reality there are loads of facts and figures that differenti­ate a good camera from a mediocre one, but we’d like to think specifical­ly about just one here: the dynamic range. In plain English, this is a measure of the difference between the dimmest and the brightest element in an image that can be recorded.

You could find a range of up to 100,000:1 in some daylight scenes, while the human eye can cope with many thousands to one. The depressing fact is that cameras don’t come close to the eye, even though a good DSLR will perform better, in this respect, than most phones or point-and-click cameras. The upshot is that it’s often impossible to correctly record the subtleties of tone in both the brightest and darkest areas of many scenes. The limited dynamic range of a camera can result in a serious lack of detail compared to what you saw with your eyes. In particular, depending on the exposure, either lighter areas such as the sky could be an almost uniform white, or the darker areas, for example shadows, a uniform black. HDR – that’s High Dynamic Range photograph­y – overcomes this problem, as we’re about to see.

Say cheese!

The basic principle of HDR photograph­y is to take several photos at different exposures, so that between them, you’ve captured much more of the tonal variation that was present in the scene than can be recorded in a single shot. Later on we’ll investigat­e ways in which those multiple shots can be combined to create a single HDR photo, but to start we need to give some guidance on taking a set of photos at different exposures, or a set of bracketed shots as photograph­ers would say.

Since they’ll eventually have to be combined, it’s important that all the differentl­y exposed shots are framed identicall­y. In fact, if there’s a slight error you’d be able to correct it by cropping your set of photos so

they all show exactly the same scene, and some HDR software can do that automatica­lly – but it’s better if you get it right from the outset. The only surefire way of doing that is to use a tripod, and if you don’t have one, you’ll be pleased to hear that they can cost just £10 or even less for very compact ones.

Ideally, we’d also recommend using a remote control or cable release, so that you don’t risk moving the camera on its tripod when you press the shutter release – but the benefit is somewhat reduced because you’re going to have to touch your camera between shots, to adjust the exposure. Actually, bracketed sets of photos can sometimes be taken automatica­lly with a single press of the shutter release button, but this isn’t available on all cameras – and even when available, it might not give you enough control for HDR work.

The process involves fixing your camera on a tripod, framing the scene, taking a photo at one exposure, altering the exposure setting using your camera’s exposure compensati­on feature, taking another photo, and continuing until you’ve got all the exposures you need. You’ll need one correctly exposed shot and, as a very minimum, shots that are underexpos­ed by one and two stops (-1EV, -2EV) and overexpose­d by one and two stops (+1EV, +2EV). For some scenes you’ll need to go further than -2EV and +2EV, but you’ll learn from experience, and it’s always better to get more shots than you really need, than too few.

Try to work as quickly as possible to eliminate any problems of clouds moving in the sky between shots – which, depending on the method you use for combining the shots, could cause problems. Don’t worry if you notice, when you review your set of photos, that some are almost all black while others are almost all white. While such shots would be virtually useless as standalone photos, they could still contain small areas that are correctly exposed and, therefore, will make useful contributi­ons to the final HDR photo.

Also, by all means capture as many exposures as you want, but bear in mind that, when you come to process them, you may not be able to use them all. In particular, shots over-exposed by more than about 3EV could well suffer from effects that will manifest themselves either as haze in parts of the image or even a prismatic rainbow appearance. The eagle-eyed might just notice this effect in a couple of the images presented here.

With a bit of time and effort it might be possible to minimise these artefacts in post-processing, but it’s easier to avoid it from the start. The effect is known as lens flare and is a fairly common phenomenon when shooting into the light. Overexposi­ng a shot increases the chances of it being visible. Using a lens hood is a good way of reducing flare.

Finally, we need to provide some guidance on how to underexpos­e and overexpose your shots. Generally speaking, there are two methods. You can set the camera to Aperture Priority mode and pick an aperture, so that when you use your camera’s exposure compensati­on feature it alters the shutter speed. Or you can set the camera to Shutter Priority mode and pick the shutter speed, so when you use your camera’s exposure compensati­on feature it alters the aperture. Both have their pros and cons for general use but, in most cases, you’ll get better results for HDR work if you use Aperture Priority. This is because the aperture affects the depth of field, which is something you’ll want to be the same between individual shots.

The manual method

A common experience is to take a photo which ends up having an almost featureles­s white or pale grey sky, even though it was a pleasing blue colour with contrastin­g white clouds to your eye. This happens when the camera exposes the shot so that the foreground is correct, with the result that the sky is overexpose­d. To start our investigat­ion of how to process a set of photos to generate an HDR result, we’ll take exactly this case as an example of how to increase the dynamic range manually, using just a photo manipulati­on package.

This isn’t the only scenario in which this method is suitable, but it’s probably the most common. The effect is different from that achievable with dedicated HDR software that we’ll look at later, but the result often appears more natural. We’re going to use GIMP (GNU Image Manipulati­on Program), but you’ll be able to get

the same results using any photo editor that supports layers and masks.

First, you need to select just two photos from your set of bracketed shots, one in which the foreground is perfectly exposed, and exactly as you’d like it to appear in the final photo, and one in which the sky has all the detail you want. Before opening them in GIMP, it might make things easier if you first rename them with ‘foreground’ and ‘sky’ in their filenames. Now open both of the photos in GIMP – they’ll appear in separate windows. Our next job is to keep the sky image as the background or base image, and to place the foreground image as a layer above that base image.

So go to the foreground image, select it (Ctrl+a) and copy in (Ctrl+c). You can now close the foreground image, discarding any changes. You’ll now have just the one image open – the sky – and you’ll notice in the Layers – Brushes dock that there’s only the one layer. Next, select Edit > Paste as > New Layer and you’ll notice that the foreground image appears as a new layer called Clipboard. You might want to rename it as Foreground by right-clicking it and selecting Edit Layer Attributes. At this point, you could just delete the top part of the foreground layer to allow the dramatic sky from the sky later to show through. However, this is destructiv­e, in the sense that once you’ve exited GIMP and, therefore, flushed its undo buffer, you can’t undelete anything.

Instead, we’re going to apply a transparen­cy mask to the foreground layer. So right-click the foreground layer and select Add Layer Mask, accepting the default of initialisi­ng to white (full opacity), before clicking on Add. You’ll notice that a white rectangle, representi­ng the mask, appears next to the foreground layer. Before going any further, and assuming that your two images are correctly registered, lock them both to ensure you don’t accidental­ly shift one layer with respect to the other. To do this, click the right-most box to the left of the thumbnail image of both layers and a chain icon will appear to show the lock.

Now all that remains to be done is to make the mask on the foreground image transparen­t in the areas where you want the sky to show through. Do this by selecting the mask, as indicated by it having a white border, and painting it black where you want it to be transparen­t. Select black as the foreground colour in the Toolbox dock and select the paintbrush tool. Now just paint the mask black, as necessary, starting with a large brush, and reducing the size (the [ and ] keys reduce and increase the brush size, respective­ly). Zoom in as necessary to define the edge more accurately.

If you accidental­ly make too much of the mask transparen­t, just make it opaque again by painting in white. When you’ve finished, save the image to preserve the layers and masks, and also use the Export option to generate a JPEG file in which all the layers and masks are correctly combined.

The automatic method

You could use GIMP to create an HDR image with more than two photos, but generally speaking if you want to go beyond the sort of effect we’ve just seen by combining a much larger number of photos, a dedicated HDR package is the way to go. Here we’re going to see how to use one called Luminance HDR which, in our experience, gives good results.

The first example we’ve chosen, while not an especially common scene, was picked because it has an unusually high-dynamic range. The scene in question

(see top-left) was taken just inside a cave entrance, looking out. A common way of photograph­ing this view is with the outside landscape exposed normally so that the cave is rendered almost totally black, framing the image. While this would be a perfectly acceptable compositio­n, we wanted to do something a bit different, so we shot no fewer than six photos, with different exposures separated by 1EV.

At one end of the range the outdoor scenery was rendered well, but the cave interior was totally black, while at the other end, the scene outside the cave was totally white, but we could see some detail in the cave. Even in this latter case, the cave interior was still modestly illuminate­d and, while we could have gone further, we took the view that caves are supposed to look somewhat gloomy.

Our first step in turning these into an HDR image is to start Luminance HDR. Bizarrely, when you do this you’ll discover that it has no maximise icon – yet you can’t see the bottom of the window, or even move it

around. However, F11 will force a full-screen display, so we suggest you do that straight away. Using Luminance HDR is pretty intuitive. Choose ‘New HDR Image’ and then, in the HDR Creation Wizard, select the images you want to combine. The images are loaded and an estimate of the exposure appears for each. You can correct these if needed. Click Next to go to the wizard’s second screen. Unselect the Preview tickbox, which will cause the Compute button to change to a Finish button, which you should now click on. After some time, you’ll be taken to the Tonemap window.

By the time the Tonemap window is displayed, the HDR image will have already been generated, but there’s a problem. In much the same way that a camera’s CCD can’t record an HDR image, ordinary (non-hdr) monitors can’t display them and printers can’t print them. In that sense, creating a HDR photo is a pointless exercise, or at least it would be without tone mapping. Tone mapping aims to process an HDR image, preserving as much as possible of the tonal range it contains, while making it displayabl­e on ordinary hardware. Inevitably this causes some artefacts which can range from subtle to extreme – although even the latter can result in a visually attractive result, albeit not altogether natural.

Now that’s clear, we can get back to the Tonemap window. At the left are loads of options that control the way in which the tone mapping operates. Next is a preview of the currently selected options and, for those who want a bit less choice, the small images at the right represent various presets that you can select. We suggest that you browse the presets first of all, and then, if none of them really fit the bill, start playing with the individual controls. Bear in mind, though, that with 15 different so-called operators (algorithms), most of which have between one and five slider controls and a few of which have tickboxes, you could be busy for quite some time.

The tone mapping default settings, as shown by the thumbnails, tend not to include the more surreal and garish type of images that are often thought of as HDR. Instead, to varying degrees, most but not all of them are moderately realistic in appearance. What’s more, playing with the controls doesn’t produce really overthe-top results. If you do crave that ‘traditiona­l’ HDR look, we suggest that you select the Mantiuk ’06 operator with the minimum Contrast Factor and the maximum Saturation Factor. If that doesn’t go far enough for you, there’s always the option of importing the output of Luminance HDR into GIMP for a bit of post-processing.

While using Luminance HDR to combine images you won’t have burnt your bridges once you decide on a tone mapping. The non-tone-mapped HDR image can be saved as an HDR file format, of which Luminance HDR supports several. This means that you can open this HDR image in Luminance HDR later on and try out alternativ­e tone mappings. It also means, of course, that you can share your HDR images with others, or carry out the tone mapping using different software.

Our reference to HDR file formats brings us to the subject of RAW files. As you might be aware, some cameras save images in a format known as RAW, in addition to more familiar ones like JPEG. As the name suggests, this is the raw image directly from the camera’s sensor, with no in-camera processing carried out. Different manufactur­ers have different specificat­ions for their RAW formats, but typically they store 12 or 14 bits per pixel per primary colour, compared to 8 bits for a JPEG file.

That might not sound a huge difference, but each additional bit doubles the number of tonal values that can be represente­d. In other words, a RAW file has a much larger dynamic range than a JPEG file and, in that respect, it’s almost an HDR format. The reason for mentioning this is that Luminance HDR can import RAW files, and even if you only import a single one, you can go on to tone-map it, producing a similar result to that achievable with a few JPEG files.

 ??  ?? GIMP enables two images to be combined by handling them as layers, the top one being rendered partially transparen­t using a mask, so parts of the bottom image show through.
GIMP enables two images to be combined by handling them as layers, the top one being rendered partially transparen­t using a mask, so parts of the bottom image show through.
 ??  ?? By using GIMP to combine a photo with the foreground exposed correctly and one with a properly exposed sky, the resultant image includes a dramatic sunset and a fully visible foreground.
By using GIMP to combine a photo with the foreground exposed correctly and one with a properly exposed sky, the resultant image includes a dramatic sunset and a fully visible foreground.
 ??  ?? In Luminance HDR’S tone-mapping stage, the HDR image is rendered in such a way that it can be displayed on screen or printed.
In Luminance HDR’S tone-mapping stage, the HDR image is rendered in such a way that it can be displayed on screen or printed.
 ??  ?? None of the exposures of this cave entrance come close to representi­ng the full dynamic range of the scene, but combining them in Luminance gives an effective result.
None of the exposures of this cave entrance come close to representi­ng the full dynamic range of the scene, but combining them in Luminance gives an effective result.
 ??  ?? If tone mapping is pushed to the extreme, the end result might not quite be realistic, but the end result can be quite eye-catching.
If tone mapping is pushed to the extreme, the end result might not quite be realistic, but the end result can be quite eye-catching.

Newspapers in English

Newspapers from Australia