Picture of HDR photos with the GIMP




Remove these adsRemove these ads by Signing Up

Step 1: Theory- photographic

Picture of Theory- photographic
What is dynamic range?



Why HDR?



Step 2: Theory- layered image editing

Picture of Theory- layered image editing
How do we do it?

HDR is where layered image editing programs such as GIMP or Photoshop are very useful. Using a technique called layer masks, we stack the photos with different exposures, rather like a stack of acetate sheets, and make the parts we don't want transparent so the best parts show through the stack. Photoshop/GIMP are doubly useful for this because we can make them do the hard work of actually making the layer masks.

Layer masks?

When stacking layers in an image editing program, it is necessary to specify how transparent you want each part of the image to be. Rather than have to do this by hand, image editing software lets you do this by providing a second greyscale image that specifies how transparent each part should be. White parts of the layer mask make the corresponding part of that layer opaque, so they show up on the finished image, and black parts make that part transparent so the lower layers show up. A couple of clever tricks in the software let you generate the layer mask from the original in a few clicks, rather than laboriously paint the entire layer mask by hand.

Step 3: Take your stock photos

Picture of Take your stock photos
For this step you will need:
- A digital camera with the ability to set aperture/shutter speed, to control the exposure
- A good sturdy tripod- this will save you a lot of trouble later

For the image editing, you will just need access to a computer with the GIMP, Photoshop or a similar layered image editing program. The specifics of this instructable will focus on the GIMP- Photoshop is very similar, but I can't speak for other software.

Find your subject- ideally it will have a high range of lighting, and not be moving too quickly- if the photos don't match up your finished image will look a little odd. Keeping this in mind, I took my photos of some trees that were blowing in the wind.

Compose your shot, and take several photos at a range of different exposures. The basic requirements for this process are one exposed as best you can, one about 1 stop overexposed (+1EV) and one about 1 stop underexposed (-1EV). If your camera has an EV meter, you can experiment with what works best, but if it doesn't just take enough to get one where the shadows expose properly and one where the highlights expose properly. Ideally, take the photos with a remote shutter release to avoid jogging the tripod- if you do this you shouldn't have to line the photos up at all later.

Step 4: Open the "middle" image

Picture of Open the
Unsurprisingly, this usually involves File -> Open... and selecting your middle image. I suggest renaming your photos from the usual "P100327.jpg" your camera may call them to "middle", "dark", "light" etc. or something similar before you start.

Step 5: Add dark layer

Open the dark image in a new window. Copy the contents, then go back to your original image (from now I will refer to this as the composite, and the other photos as the stock). Create a new layer, with Layer -> New Layer, rename it something sensible like "Dark layer"- the initial colour settings are unimportant. Paste the dark stock into it, and hit Anchor. You should now have the middle image on the background layer, and a new layer with the dark stock in it above that- the window holding the composite image will now show just the dark layer.

Step 6: Make the dark layer mask

Picture of Make the dark layer mask
Now go back to the dark stock image. Desaturate the image (convert to greyscale) with Layer -> Colors -> Desaturate. This forms the basis of your layer mask- the white parts will be opaque in the composite, and the dark parts transparent, meaning the composite will just take the correctly exposed parts of the dark stock image.

If the image is mostly black and dark grey like this one, you will want to brighten it up a little. Go to Layers -> Colors -> Curves... and you should see a histogram with a diagonal line across it. The "lump" in the middle of the histogram shows the brightness levels of the grey parts in the layer mask image. Drag the middle of the curve upwards so the part above the spike on the histogram is near the top of the window. Your image should now be a lot brighter. This part is not an exact science- the more you raise the curve, the more the composite will draw from the dark stock image, so the more pronounced the HDR effect will be. Experiment to find the best values for your photos.

Step 7: Apply the dark layer mask

Picture of Apply the dark layer mask
Copy the contents of the dark layer mask image. Go back to the composite, and open the layers window (Ctrl-L or Dialogs -> Layers). Right-click on the dark layer, and select Add Layer Mask- the initial settings are unimportant. Now everything that you do to the dark layer will happen to the layer mask. Grab the paintbrush, select white or black and paint a little on the image- you should see where you paint show one or other of the photos in the composite. Now paste the layer mask onto the dark layer (select the dark layer and Edit -> Paste). Anchor the pasted layer down.

The composite image should now have less silhouette in it and appear a little more "vibrant". To see the effect the layer is having, check and uncheck the visibility eye next to the layer- you should see the dark parts of the image change, but the lighter parts be unchanged. If the effect is too pronounced or too subtle, go back to the dark stock image, undo the curves operation and redo it to a different extent, and repaste the layer mask until you are satisfied with the result.

Step 8: The light layer

Picture of The light layer
This process is almost exactly the same as adding the dark layer but with a few notable exceptions. Open the light stock image, paste it into a new layer in the composite and desaturate the stock image as before.

Now, the desaturated image is not quite ready for being used as a layer mask. Remember the white parts make the image opaque, and black makes it transparent. If you used this as a layer mask, it would use the bright parts of the bright image and the dark parts of the dark image- the exact opposite of what we want. To rectify this, invert the greyscale image (Layer -> Colors -> Invert). If your image needs brightening, do the curves operation as before- mine didn't, so I skipped this step.

Copy the bright layer mask image, create a layer mask on the light layer and paste the bright layer mask image into it as before. This should make the brighter parts of the composite image mroe vibrant- it usually has the effect of making daytime sky more vivid blue, increasing the colour gradient and decreasing wash-out.

Step 9: Your first HDR image!

Picture of Your first HDR image!
You now have your first complete composite HDR image! Save the image (preferably a layered copy as well as a flattened JPEG), and compare it against the original "middle" stock image- it should have less silhouette and wash-out, and more vivid colours. Often subtle HDR images look like paintings, because the painter's eyes have a much higher dynamic range than the camera so they will paint more like a HDR image. More extreme images often have a slightly dreamlike or "hyper-real" quality.

Experiment with different settings, taking a wider range of exposures for your stock photos, or using more than three layers. All the techniques described here can be extended to five or more images- just remember to invert the layer masks for layers brighter than the middle image, and use the curves tool to normalise your layer masks.

Step 10: Recap- steps for creating brightness-mapped HDR


- Open middle image as background
- Desaturate dark image
- Adjust curves on dark image to set levels
- Invert colours in stock image, adjust curves if necessary
- Save image

Step 11: Hold on.. "brightness mapped"?

Picture of Hold on..
Astute readers may have noticed the previous step was labeled "for brightness-mapped HDR". There are other techniques for achieving a similar effect, which I will outline, but the process is broadly the same other than creating the layer mask image.

Tone mapping refers to another method for creating layer masks. While the previous instructions used the brightness of the stock image to create the layer mask, another school of thought says that the interesting parts of a stock image are those with the greatest local contrast. To make a tone-mapped HDR image, once you have desaturated the stock image, choose Filters -> Edge-detect -> Edge... and select Sobel. This will create a new image where the edges in the stock photo are highlighted in white, the uniform areas are filled in black.

This image is again not yet suitable for use as a layer mask- the edge-detected mask has too much "ripple" in it, and if used for a layer mask will create a very patchy image. To smooth out the edge map, go to Filters -> Blur -> Gaussian Blur. Now you will need to put in the rough width of the ripples in the edge-detected mask. This will vary depending on the size of your stock photo- I shrunk mine to 572*428 (because I was editing them on a 500MHz PIII over a remote desktop connection.. it was traumatic), so 5 pixels was fine, but full-res 6 megapixel shots may require a larger radius. You are aiming for the ripply areas to be blurred to a more-or-less uniform grey, but not to smear the white areas out too much- again, experiment.

Once you are satisfied, copy the edge-detect map to use as a layer mask as before. Note that as this picks out areas of high detail, you don't need to invert the maps from your bright layers before using them as layer masks.

Brightness mapping tends to create a subtler effect, slightly increasing the colour in the image for a natural feel, whereas pure tone-mapping often gives a more dreamlike or psychedelic quality. Once I figure out how to combine a brightness map with a tone map to get a little of both, I'll edit it in here.

Step 12: Man, that was a lot of text

Paste the bright and dark stock images into the composite as separate layers. After desaturating the stock images, perform an edge detect (Filters -> Edge-detect -> Edge... -> Sobel), then a Gaussian blur to remove the rippliness of the edge-detect (Filters -> Blur -> Gaussian Blur). Use this image as your layer mask as before.
1-40 of 59Next »
SteveD15 made it!22 days ago

third attempt .... but works

davidbarcomb8 months ago

Amazing tutorial. Thank you for this


in3D1 year ago




oshman67851 year ago


Steps to convert Images to HDR using
the gimp 2.8.10

  1. Open the middle image. Rename that
  2. Open the dark image, copy the full
    Rename this layer...
  3. From the layers toolbar, right
    to: Grayscale copy of layer.
  4. Open the light image, copy / paste
  5. Again, from the layers toolbar,
    mask a negative.



cyberrian1 year ago
cdubnbird2 years ago
aoakes23 years ago
waiting19623 years ago


geekguyandy7 years ago
PKM (author)  geekguyandy7 years ago
geekguyandy PKM7 years ago



This plugin is amazing, thanks for sharing it!
PKM (author)  ScaryDave7 years ago

ScaryDave PKM7 years ago


No wonder it is Free!

sp_key Scwounch5 years ago
Like linux, drupal, php and almost all programming languages?


zerolols6 years ago
Its a poor workman who blames his tools...
PKM (author)  zerolols6 years ago
joshmatix PKM6 years ago
rmfought4 years ago
endolith5 years ago
arewealmost5 years ago
PKM (author)  arewealmost5 years ago
dscotthep5 years ago

pr3tard5 years ago
pajoohesh5 years ago

thepaul935 years ago
that's great for commercial use but for home use gimp's free.
raudibert6 years ago
EOBeav6 years ago
eat_squids6 years ago
zoom1236 years ago
1-40 of 59Next »