Active Delight !

I took some pictures of some lovely jewelry my lovely wife made, yesterday. And when I went back today to look at the results, I noticed something odd. There was an unexpected dark halo around the subjects.

Nikon D90, 105mm macro

I thought hmm... is my fancy macro lens prone to some strange halo distortion when shooting bright subjects against medium-blue backgrounds ? I sure hope not - that's not a cheap piece of glass. So, I did some research about lenses and dark halos on the web, but didn't find anything that sounded like the problem I was seeing. Stumped, I did the next best thing to Googling: a scientific experiment! I put a different lens on the camera and tried the same shot. Result? Exact same problem. So it probably wasn't the macro lens (whew). It was likely the camera.

Was it a sensor problem? This shot was done in full sunlight, against a sun-lit wall (it's a much brighter scene than it appears), which is a pretty typical scene, right? If the sensor couldn't handle that, it would have to be horribly defective. Googling around looking for info on defective D90 sensors producing dark halos, I found the answer. It's not a bug, it's a feature. It's Active D Lighting.

ADL is a feature on newer Nikon cameras and it's pretty cool: it analyzes the scene, finds the bright and dark areas, then adjusts the brightness/contrast in those areas to bring out more detail. Ex. it sees a big patch of really bright pixels in the image and turns down the brightness just a bit, while increasing the contrast just a bit - but only in that area. So any details which were hiding in that bright patch become a bit more visible. And then it does the same for dark spots, too - increase the brightness and contrast just a bit. And it does all this on the fly. And it does this by default.

Turn off Active D Lighting and...

Nikon D90, 105mm macro

Voila! No more halo.

OK, but how does that cause a halo?

Well, I'm not exactly sure what algorithm it uses, but I can take a guess. I'll guess that it does something close to the old photographer's trick called a contrast mask. Basically you make a blurred, negative, black and white version of the original and combine that back with the original in such a way that the blurred image controls the brightness. Dark areas brighten, and bright areas darken, and the contrast in those areas go up (and the contrast of the whole image goes down a bit because you've flattened out the extremes). This is trivially easy to do in software, and it works! And it sounds an awful lot like ADL...

In a contrast mask, the blur is the trick, because it turns the image into simple patches of light and dark, so you can say "this here is the bright area, and this over here is the dark; we'll just change those areas", without worrying about details.

So, let's do that:

B&W, inverted, blurred in Photoshop. You can kindof see the 'shapes' in there.

And when combined that back with the original image (using Photoshop's "Overlay" blending mode):

Ta da! Look at that beautiful halo! Mystery solved - well enough for me, anyway,

Moral of the story: Active D Lighting is something like a contrast mask, and can give really good results in some situations. But if you have a high contrast shot with a solid background, Active D Lighting is going to create ugly halos.

Lesson learned.

7 thoughts on “Active Delight !

  1. Mike Mundy

    . . . and, I think, one can combine two bracketed images using the same technique? I’ve never been able to make it work though.

    One hopes that Balloon Juice readers will enjoy this techie post.

  2. cleek

    Does your wife sell any of her jewelry?

    yeah, she does. she doesn’t have any kind of on-line store right now. but i think she’s working on it (that’s why she had me take the pix, i believe).

  3. cleek

    and, I think, one can combine two bracketed images using the same technique? I’ve never been able to make it work though.

    is that the pre-digital way to do HDR images ?

    One hopes that Balloon Juice readers will enjoy this techie post.

    a little tech is good for everyone, enjoy it or not.

  4. wagonjak

    I for one thought the dark shadows around the jewelry were just shadows, and actually made the earrings look brighter and more beautiful…getting rid of them flattens the whole image out and deadens the effect of the sparkling earrings.

    Not meant as a criticism, but I’m a photographer and a photoshopper and I don’t see the problem with the original shot.

  5. cleek

    hmm. yeah, i guess you’ve got a point there – it does look a bit like a shadow. and if it was a shadow, that might not be a bad thing. looks a bit like PS’s “outer glow” effect, too. it never occurred to me that they could be shadows though, because i know the light was coming from the top-left (you can see the real shadows under the hoops), not from the camera.

    here’s a similar example of ADL getting a little carried away.

Comments are closed.