FREN

#FF00AA


16 feb. 2006

HDR Photography

@photo@

For a couple of days the web has been abuzz with links to the HDR pool on Flickr, so I figured that was a good opportunity to take my camera out again, after several months without touching it at all.

HDR (high dynamic range) consists basically of storing in a picture file much more information than a computer screen can display. A regular bitmap file (e.g. a JPEG you create on Photoshop or with your camera) stores each pixel as three 8-bit values (for red, green and blue) which, combined, give the pixel’s color — that makes for 16 million different colors, and it’s already slightly more definition than your average computer screen can really display. A digital camera’s RAW file typically stores 10 or 12 bits per pixel — that means four to eight times (one more bit equals twice as many possible values) more definition (I’m not talking resolution, here, but luminosity values — actually, the resolution itself, i.e. the number of pixels is three times less, if I’m getting this right, but that’s not the point), which is why it’s recommended to shoot RAW if you have enough memory card space, so you can correct the exposure afterwards and reveal highlight/shadow detail that would have been definitively lost if the camera had saved the picture as JPEG. Finally, in an HDR image, pixels are usually made of three 16-bit or 32-bit values, and they’re floating-point rather than integer, which means that they range from zero (pitch black) to infinity (supernova) rather than be clipped at either end (like zones being all white because there’s too much light).

Okay, that’s fascinating (or not), but how does it apply to real-life photography? Simple: as the most common example goes, if you’re in a cathedral and want to take a picture of sunlight through the stained glass, either the glass will come out completely white or the inside of the cathedral will be black, depending on which exposure you or your camera chose. A regular bitmap can’t capture the contrast between direct sunlight and the darker shadows (which is also why, if you’re not extra careful, landscape pictures often come out with washed-out skies); an HDR picture can:

Hold on, now: that was a JPEG, and it was displayed on my monitor, how could it be HDR? Well, it can’t, and that’s the trick: an HDR picture can theoritically store the full possible range of luminosity as seen in the real world, but there’s no way it can be fully reproduced. You necessarily have to convert it to something a computer screen can show (there are HDR displays, but even then it’s still an approximation — unless you have a fusion reactor inside, they can hardly emit the same amount of light the sun does). But HDR is still useful (beyond photo-realistic motion blurs in Half Life 2) in that all this information you can’t display is inside the computer, which means you can use it to improve detail in the highlights and shadows of your photographs, and fiddle with settings until you get the very best possible picture of your cathedral, with everything as clearly visible and as detailed as can be.

Now, if all you’ve got is 10 or 12 bits of information per pixel in your digital camera, how do you make a true HDR photograph anyway? Quite simply, you just take several pictures at different exposures: one exposure optimized for the stained glass, one for the detail on the walls, and one or several in between (which means it’s only applicable to still life and landscapes — no portraits or action photography unless you find, or build, or invent, a true HDR camera). Put them all together and you’re all set. Well, actually, not — that was the easy part. Now you have to convert the HDR picture into a regular JPEG, and that’s when you start to get headaches.

In the rest of this article I’m detailing the process a bit and posting examples made with Photoshop CS2’s “Merge to HDR” feature and with Photomatix. Spoiler: most experiments were pretty disappointing.

There appear to be two major options for assembling multiple photographs into an HDR image: Photomatix Pro ($99, fully-functional demo with watermarks) and Photoshop CS2 ($649, heh, 30-day tryout). Both are available on Windows and Macintosh, and work the same way: select your source photographs, after a while a window will open with an HDR image that looks like crap, because it’s HDR displayed on your non-HDR monitor. (For some reason neither can directly import a series of RAW files, although it seems to me that would be the best way to retain the most information. Photomatix offers to create an HDR file from a single RAW file, but I’m pretty sure that would yield less data than TIFFs of several exposures. Still, it can be useful if you want to process an action shot or portrait — because, like I said above, RAW files already contain more information than an eight-bit-per-channel bitmap will handle — and you can do the same in Photoshop by first creating different exposure shots from the same RAW file.) By the way, if you’ve got Photoshop CS2 on your hard drive (like, because you bought it or something), the place is File / Automate / Merge to HDR.

Like I said, the most important part now is converting your HDR file back into a regular bitmap, something you can display — basically “developing” the picture, like when you’re using your camera’s RAW software, only with much more control. (Photoshop also allows you to apply some filters while the picture is in HDR, which I suppose would produce better, more accurate results than working after conversion, although I lost interest when I saw that “Lens Blur” was not available.)

Here are the first pictures I tried it with:

Three pictures of my bedroom, with moderate sunlight (it’s February) in the window, using my PowerShot G3’s bracketing option and a mini tripod (although both programs offer to try and align your pictures automatically, tripod is just plain compulsory). This is actually the hardest test (well, it would be if it were summer): the outside and inside are very contrasted, the delimitations are very clear, and there are lots of details to preserve in both — the exact opposite of the simple landscape + sky shown in most examples.

And here’s what I got from Photomatix, using different options:

(As you can see, some of the modes — not necessarily the worst — are available sans watermark, so Photomatix Pro is worth installing even if you’re not going to buy it.)

Isn’t that ugly? Yeah. It is more informative — you do see more detail than you did in the original middle picture — but it looks terribly dull.

And here are the Photoshop results (you’ve got to go to Images / Mode / 8 Bits/Channel):

Well, that isn’t too pretty either.

 

Why don’t we try with more pictures? Maybe three difference exposures wasn’t enough to make something good.

Here’s the best I can get (top, Photomatix, bottom, Photoshop):

Okay, I can’t say I’m impressed. No, actually, I’m quite disappointed. I’m sure I could fine-tune it a bit more, use Photoshop layers to inject some of the original photograph’s life back, and I started out with the plainest pictures ever, but the whole process pushes actually tends to increase the dullness factor.

 

Okay, let’s try something simpler then, and somewhat prettier, a good old landscape with the sky above:

Photoshop, with the “Exposure and Gamma” method:

Sure I could work something out of it with heavy editing, but it wouldn’t be worth it.

Photoshop, “Local Adaptation” method with some curve tweaking, plus the original photograph superimposed as a “Color” layer afterwards to liven it up a little:

Yeah, that’s somewhat usable.

Photomatix, reducing “Strength” to 10 and boosting “Color Saturation” a bit:

Okay, that isn’t bad either.

And, now, the fun one, Photomatix with “Strength” back to 100:

There. It is pretty. It’s ominous and moody. It reminds me of Vidocq. It looks like a painting. But that’s the thing: it looks completely unreal. Well, it should because our eyes never see things that way but what there shouldn’t be, however, is a big dark halo all around the sky.

That’s not shading, that’s not a natural gradient, that’s not the way it’s supposed to look: it’s just an artifact caused by their algorithm — check the sources again. And that’s why this thing works best on simple landscapes with hills and flowers and whatnot: you don’t notice that kind of artifact on a grassy hill; you only assume it’s natural shading.

 

So, basically, you have a choice: you’ll either get the dullest images ever, or a surreal painting with weird halos everywhere. Look at the HDR pool again and pay close attention the the delimitations between landscapes and skies: you’ll see halos on most. (Not to mention those that look as ugly as my first tries, with splotches of grey all over.) Great for that cartoony, unsettling look, but it’s not photography anymore.

 

Oh, and it’s not that I didn’t use it right: you can look at HDR Soft’s comparison of Photoshop CS2 and Photomatix. Photoshop images are dull, clinically accurate, while Photomatix renders are painterly and full of halos.

 

The Luminous Landscape:

Not every image needs to have 10-15 stops of dynamic range. In fact, most photographs look quite nice, thank you very much, with the 5-7 stops of dynamic range that we’re used to. I fully expect to see some really silly if not downright ugly images in the months ahead, as photographers get their copies of Photoshop CS2 and start discovering what the HDR function is capable of.

But, as with all such tool, in the hands of sensitive artists and competent craftsmen, I’m sure that we will start to be shown the world in new and exciting ways.

 

I’ll try shooting some RAW files in the coming days and see what Photomatix makes out of them, because it makes fun images, but I’m not seriously adding HDR to my workflow.

Want to know when I post new content to my blog? It's a simple as registering for free to an RSS aggregator (Feedly, NewsBlur, Inoreader, …) and adding www.ff00aa.com to your feeds (or www.garoo.net if you want to subscribe to all my topics). We don't need newsletters, and we don't need Twitter; RSS still exists.

Legal information: This blog is hosted par OVH, 2 rue Kellermann, 59100 Roubaix, France, www.ovhcloud.com.

Personal data about this blog's readers are not used nor transmitted to third-parties. Comment authors can request their deletion by e-mail.

All contents © the author or quoted under fair use.