Tuesday, July 28, 2009

Let's rehabilitate HDR

This is not HDR.



Seriously? Engineers do their best so the user can have nice images of sunsets or photographing grandma while facing the sun and here comes a group of photoshoppers ruining everything.

I think it's time to set the record straight and explain what is actually HDR - high dynamic range.

An image is generally encoded using 8 bits per channel. 8 bits = 28 = 256 levels. A black and white image can thus be encoded using 256 grey levels. Is that a lot? Not really. Really not. The ratio between the lightest point - the sun - and the darkest point - no, not grandma - may be around 10,000 to 1. That's precisely what's called dynamic range. That means that it's not possible to simultaneously image details in shadows and highlights, which will be most likely "burnt."

Good news is that camera sensors can capture more that 256 light levels. Typically, in raw format, an image has 12 bits per channel, i.e. a little over 4000 grey levels. Getting better. But the problem of transforming a 4000 levels image into a standard 256 levels image remains. This must me done is a smart way, keeping details in both the dark and light parts of the images and a natural appearance by avoiding the artifacts apparently cherished in "artistic" HDR - see image. There's actually an in-camera tone-mapping allowing the user to display a decent looking 8 bits images in her/his screen without any additional work.

There's also another way of doing HDR. Take a series of pictures with different exposures. Typically, an underexposed image containing details in highlights, a correctly exposed image containing details in midtones, and an underexposed image containing details in the shadows. Then merge the images in a way that preserves a maximum of details and get a nice image. Easier said than done... One must work with linear images, correctly merge the image, and applied a "good" tone mapping...

Artistic HDR is probably much simpler....

For those who are interested, the serious stuff's here.

No comments:

Post a Comment