How to create a HDR (high dynamic range) image from a single photo

This is my take on how to create a HDR-type image using a single photo. It’s written for beginners, and will take you through the process from beginning to end. It’s likely to take 30 minutes or so first time, but you’ll get quicker as you repeat it. If you want to know what a HDR image is, there’s an excellent demonstration over at Wikipedia.

First of all, so you have an idea of the kind of thing that can be achieved, here’s the image I made earlier today, followed by the original.

This is the HDR-type image after rendering

This is the HDR-type image after rendering

This is the original photo, a JPEG of a round 3Mb in size, taken with a Canon Ixus 80 point-and-shoot:

This is the original, from which the HDR image is created

This is the original, from which the HDR image is created

I think this illustrates the first rule of HDR processing – start with a decent photo! It won’t transform a bad photo into a good one, but it might make a good one even better. (Bear in my that these images are downsized and saved into different formats so I can add them to this blog: trust me when I say they look better in their original, high-definition formats!)

What you’ll need

This isn’t a completely automated process, but it doesn’t take very long. You will need the following:

  • A photo you’re happy with. It can be in almost any format. If you’ve already seen some HDR images, you’ll know the kinds of things that work well – high contrast landscapes, with dramatic skies and water are common – but try different images, see how well they work.
  • Adobe Photoshop CS2. I understand the latest versions of Photoshop cannot generate HDR images out of the box. There are other HDR rendering software out there: many use and enjoy Photomatix, for example.
  • I used iPhoto to adjust the exposure settings for the images, since it’s quick and easy and I’m familiar with it. Photoshop will do it too.
  • A bit of time, since – depending on your computer’s processing power – these images can take a little while to render. I’m using an iMac running Photoshop through VMWare and it only took a couple of minutes.

Getting started

First you’ll need to generate three copies of a single photo with three different exposures (different levels of light and dark).

  • If you’re using iPhoto this is easy. Open the photo in iPhoto and duplicate it twice so you have three photos in total. I prefer to make a new album or new event and put them in that so it’s clear what I’m doing.
  • Now click on ‘Edit’ then bring up the ‘Adjust’ set of histograms (the graphs which show the different levels of exposure, contrast and so on).
  • Set exposure for the first photo to -3; leave the second photo at 0; set the third one to +3. That is:  the first one is dark (-3); second one is normal (0); third one is light (3).

Now you’re going to need to start Photoshop for the next bit.

  • Open Photoshop and open each image all together (select them all from the File / Open menu). They should by default cascade (organise) themselves onto the screen.
  • With the photo open, choose File / Save for Web (it doesn’t matter where you start, just use the first one that you see).
  • When you’re done with the first one, close it and start on the second. As you close it, Photoshop will ask you to save it: don’t: click ‘No’. You should have already saved it as ‘Save for web’. Save each each in turn like this.
  • I make a new folder for ‘Save for web’ images, so I know what I’m doing – I usually add ‘_HDR’ to the end of the folder name and/or photos, so I can differentiate them from the originals.

If you want to know why we had to save them for the web, read the section ”Why save the files for web?’ below.

But for now –  you’re ready to make a HDR!

Using Photoshop’s ‘Merge to HDR’ to create your image

  • With Photoshop open, choose File / Automate / Merge to HDR in the menu.
  • It will ask you to find the images you wish to merge. Add the three that you have saved above. You don’t need to check the ‘Alignment’ checkbox since all images are the same.
  • A dialogue box may appear which says ‘Manually set EV’. If it does, you’re going to need to set the levels for each photo manually in the ‘EV’ value box.
  • To manually set levels, click on the ‘EV’ button. It will be active, ready for you to enter the levels. For the under exposed / dark photo, enter ‘-3’; for the normal photo, enter ‘0’ (zero); for the over exposed / bright photo, enter ‘3’.

When you’ve done that, hit enter. The dialogue box will disappear and another new one will appear in the top right.

  • You can just hit enter here – don’t be disappointed with the image since it might not look much different – we’re not done yet!
  • Now, go to the pull down menu and choose Image / Mode and then adjust the bit rate to 16.
  • A histogram should appear, in a box titled ‘HDR Conversion’ (if it doesn’t, click the down arrow to open the part of the box). Now you’ll need to make some adjustments – this is the fun bit, and you’re getting nearer to the end result.
  • From the pull down menu , choose ‘Local Adaptation’. The image will likely go very bright at this point.
  • There is a point at the bottom left-hand corner of the histogram. Drag this point until it it meets the first of the major ‘spikes’ on the graph. As you move the point from left to right the image should become darker. Adjust the image to find the best balance of light and dark.

When you’re done, click ‘Ok’. The image will run through a final, brief conversion and voila – there it is.

Hopefully you’ll be overwhelmed with the result!

What to do next: improving and sharing your images

If you’re less than overwhelmed, this might be for a number of reasons. One is that the photos do not have sufficient levels of dark and light. To change these levels, go through the process from ‘Using Photoshop’s ‘Merge to HDR’ to create your image’ above, and choose a broader range for your values. So, rather than choose -3, 0, 3 try choosing -5, 0, 5 instead.

You might also try more photos at different exposures, to see if this improves the overall effect. You can make adjustments in Photoshop, including some of the automated ones if you’re uncertain what you’re looking for: use the Image / Adjustments menu and choose an automated adjustment there.

Experiment with different images. Some lend themselves better to this treatment than others. Try ones with quite a bit of contrast, natural scenes outdoors, perhaps some city lighting at night.

Look for subtle changes. Not all HDR images have to look completely different – sometimes the additional changes in texture can really improve a photo. Have a look here, first at the HDR image and then the original:

The effect can also be quite subtle

The effect can also be quite subtle

The image above has subtle changes in vibrancy, as well as major changes in the texture, giving it a more full-bodied feel when compared to the original, below:

The original photo: note the subtle difference in texture

The original photo: note the subtle difference in texture

When you’ve tried this, why not share your experiences below in the comments and add links to your images – I would be really interested to see how you’ve used this process, or tailored it to your needs and resources.

Follow me on Flickr (click here). I post often, including HDR images. This is one of the best ways of getting to see what other people are doing and asking questions, as well as sharing your work.

Why use this method?

We’re not creating a true HDR image using the technique I’ve outlined above but one that approximates its effects. The best way to take a true HDR image is to set up your camera on a tripod and take three or more shots of an identical image with different exposures. Even better – use a DSLR camera and set the file type to ‘RAW’. Only then will you achieve some of the amazing results you’ve probably seen online.

However, that is not always possible or even desirable. Sometimes we want to take shots with movement – perhaps they’ve got people in them, or traffic – and so using three or more images will be problematic, since we need them to be the same. What’s more, you can convert some of those old favourites you took before you knew anything about HDR!

Why save files for the web?

The problem we have is that Photoshop uses the EXIF data – the camera settings, date and time it was taken, etc – to help it decide how to automatically render the images to HDR. If you don’t strip out the EXIF data it will return an error, telling you there’s not enough range to create a ‘useful’ image. That’s because you’ve simply duplicated the photo and therefore all its EXIF data, and manually changed its exposure: each photo, although they look very different, will have identical EXIF data. So, we need to strip that out. There are several ways of doing this: I used Photoshop to do it.

Outline of this approach

If you know how to use Photoshop and iPhoto or just want a reminder, this is what I did in outline:

  • Used iPhoto to adjust the exposure of three different images, from -3 to +3
  • Save these three photos in ‘For the web’ format using Photoshop CS2, stripping out the EXIF data
  • Rendered using Photoshop’s ‘Merge to HDR’ automated process
  • Saved to 16 / 8 bit and adjusted the ‘Local Adaptation’ to improve the image.

Acknowledgments

Two websites were especially useful when going through this process: this one and this one. Without them, I wouldn’t have known where to start. Thanks!

Advertisements

One thought on “How to create a HDR (high dynamic range) image from a single photo

  1. Pingback: HDR | RCC Digital Imaging

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s