The Exposure Blend Script-fu Tool

Note: This article is intended for intermediate level users of GIMP

In recent years many people have grown interested in High Dynamic Range (HDR) photography. This growing method for taking beautiful, almost surreal, images is made possible through different software programs. Photoshop CS4 is a popular option for this and produces beautiful HDR. But with an over $600 price tag Photoshop isn't for everyone. Luckily there is a Script-fu for GIMP called Exposure Blend which - along with a little tweaking of our own - creates beautiful near-to-HDR images.

Script-Fu?

One powerful Feature of GIMP is the ability for users to script custom actions for how the program handles and image. Because of this GIMP has virtually unlimited potential to expand and grow. These scripts can be shared online and easily installed to solve complex or obscure image problems.

To install the Exposure Blend script you must first download it. Either right click on the following link and choose "Save As" or follow the link, copy the text you find into a notepad document and save it as "exposure-blend.scm".

Click here for exposure-blend.scm

Once you have downloaded the file you need to add it to your Script library. This is done my saving or copying the folder to the directory where scripts are stored. In windows this will be "C:\Program Files\GIMP-2.0\share\gimp\2.0\scripts" by default.

Once you have placed the file into this directory the next step is to refresh your script library. Do this by opening GIMP, going to the "Filters" menu, selecting "Script-Fu" and then "Refresh Scripts". This checks the scripts directory and loads any new scripts into the GIMP. You should now see an "Exposure Blend" option in the Filters menu.

Exposure Bracketing

Before you can combine images with multiple exposures into a single image you will first need to be able to make images with multiple exposures. For this purpose a tripod is essential. All the images you will use should be identical (or as close as you can get) in terms of the image content. The only difference should be the exposure settings which should be staggered. This can be achieved easily using exposure bracketing found on many DSLR cameras. Exposure bracketing will automatically adjust the exposure to produce a series of three images wherein one image is underexposed (dark), one image is normally exposed and one image is over exposed (bright).

You can also do this by manually adjusting the exposure settings to produce these three images but you need to be very careful about using a tripod to minimize movement of the camera between shots. If the shots are drastically different it will be hard (or impossible) to align them properly.

Once you have a set of exposure bracketed images you are ready to start.

Here are the three images I took of a tedding machine for this demonstration:

Under Exposure Normal Exposure Over Exposure

Time to Blend!

Once you have all three exposure bracketed images it is time to blend!

To begin, access the Filters menu.

Filters>>Exposure Blend>>Blend

Selecting the script

Next a dialogue box will appear with the different settings for the Exposure Blend script. If the box isn't immediately apparent check the task bar as script boxes will sometimes appear behind the main GIMP window.

Script-fu - Blend with Images Selected.
Exposure Blend box with Files Selected

Click the file icon and browse to select your Normal Exposure, Short Exposure and Long Exposure image files. After selecting your files use the default settings for the rest of the options and click OK to run the script and overlay the images.

After the script runs bring up the Layers dialogue (ctrl+l) and you will see there are three layers. The top layer is the brightest exposure, the next layer is the darkest exposure and the base layer is the normal exposure. The upper two layers have inverted color layer masks which can be used to compare the alignment of the layers.

To do this there are additional functions built into the script. Begin by aligning the bright layer. Do this by:

Filters>>Exposure Blend>>Align Exposures>>Bright

Align Masks - Bright

This will cause a drastic change in the image but this can easily be reversed and should not be cause for alarm. You will now see the inverted bright layer overlaid against the normal exposure. Using the move tool select the top layer by clicking the image and now experiment with adjusting the position of this layer by dragging it with the mouse or - for more precise movements - with the arrow keys. Using the arrow keys allows you to shift the exposures by as little as one pixel at a time. When the images are overlaid well the image will look relatively flat and you won't see strongly defined or exaggerated edges.

Align Masks - Bright - Misaligned
Bright Mask - Not Aligned
Align Masks - Bright - Aligned
Bright Mask - Aligned

Repeat the process with the dark layer:

Filters>>Exposure Blend>>Align Exposures>>Dark

Return to the original blended image view (with alignment changes):

Filters>>Exposure Blend>>Align Exposures>>Off

If you have moved the image around at all the layers won't overlay perfectly so crop to the overlap area:

Filters>>Exposure Blend>>Align Exposures>>Trim Image to Overlap Area

That is pretty much it for using the Exposure Blend script. You will want to save your image as a JPG or other file type before doing any other changes to the image. If you try and adjust the color balance or levels before flattening the layers you will only affect the top layer and this will not have the effect you going to achieve.

Here is the final image after it has been blended and aligned:

Blended and Aligned

Once you have saved your merged image you will probably want to adjust the levels. While a powerful tool, Exposure Blend is not a true HDR program. As such the images formed through this process may look grey or slightly washed out. This can be fixed by adjusting the color levels of the image.

Back to Index