{"id":6491,"date":"2009-08-07T16:39:52","date_gmt":"2009-08-07T20:39:52","guid":{"rendered":"http:\/\/ok-cleek.com\/blogs\/?p=6491"},"modified":"2009-08-07T16:39:52","modified_gmt":"2009-08-07T20:39:52","slug":"active-delight","status":"publish","type":"post","link":"https:\/\/ok-cleek.com\/blogs\/?p=6491","title":{"rendered":"Active Delight !"},"content":{"rendered":"<p>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. <\/p>\n<p><img decoding=\"async\" src=\"\/images\/earrings1.jpg\"><\/p>\n<div class=pinfo>Nikon D90, 105mm macro<\/div>\n<p>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.<br \/>\n<!--more--><br \/>\nWas 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. <\/p>\n<p>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.<\/p>\n<p>Turn off Active D Lighting and...<\/p>\n<p><img decoding=\"async\" src=\"\/images\/earrings2.jpg\"><\/p>\n<div class=pinfo>Nikon D90, 105mm macro<\/div>\n<p>Voila! No more halo. <\/p>\n<p>OK, but how does that cause a halo?<\/p>\n<p>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, <a href=\"http:\/\/www.smalleranimals.com\/vforum\/showthread.php?t=2538&highlight=contrast+mask\">and it works!<\/a> And it sounds an awful lot like ADL...<\/p>\n<p>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.<\/p>\n<p>So, let's do that:<br \/>\n<img decoding=\"async\" src=\"\/images\/earrings4.jpg\"><br \/>\nB&W, inverted, blurred in Photoshop. You can kindof see the 'shapes' in there.<\/p>\n<p>And when combined that back with the original image (using Photoshop's \"Overlay\" blending mode):<br \/>\n<img decoding=\"async\" src=\"\/images\/earrings3.jpg\"><\/p>\n<p>Ta da! Look at that beautiful halo! Mystery solved - well enough for me, anyway,<\/p>\n<p>Moral of the story: Active D Lighting is something like a contrast mask, and can give <a href=\"http:\/\/sportsphotoguy.com\/active-d-lighting-on-the-nikon-d300\/\">really good results<\/a> in some situations. But if you have a high contrast shot with a solid background, Active D Lighting is going to create ugly halos. <\/p>\n<p>Lesson learned.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22],"tags":[],"class_list":["post-6491","post","type-post","status-publish","format-standard","hentry","category-photos"],"_links":{"self":[{"href":"https:\/\/ok-cleek.com\/blogs\/index.php?rest_route=\/wp\/v2\/posts\/6491","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ok-cleek.com\/blogs\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ok-cleek.com\/blogs\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ok-cleek.com\/blogs\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ok-cleek.com\/blogs\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6491"}],"version-history":[{"count":0,"href":"https:\/\/ok-cleek.com\/blogs\/index.php?rest_route=\/wp\/v2\/posts\/6491\/revisions"}],"wp:attachment":[{"href":"https:\/\/ok-cleek.com\/blogs\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6491"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ok-cleek.com\/blogs\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6491"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ok-cleek.com\/blogs\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6491"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}