Options

Even the histogram will lie to you

Scott_QuierScott_Quier Registered Users Posts: 6,524 Major grins
edited April 29, 2009 in Technique
We all know about "Exposing to the Right" to get as much photographic data as possible, right? How many times have you done a shoot, checking the histogram and the picture on the LCD (for the blinkies) all the while to make sure you don't over-expose your shots only to get home and find that your shots are not exposed as far to the right as you had been led by your histogram to believe? Happened to me all the time, but I thought there was not much I could do about it ... that I had to learn to compensate for the goofy camera.

Some short time ago, I stumbled across the concept of the UniWB. Seemed like an awful lot of work. More research and I've found a way to make it easy....

Here's the premise. There's more lattitude in the RAW file than the camera is telling you. The histogram and the blinkies represent what's left of the image data after the camera has applied all the "in-camera" presets and genereated the JPG. It gives you no indication of the room you have left in which you can recover the more exposed regions of the photo or the extent to which you can dial back the exposure in post.

The question then becomes, "Well, can we teach the camera to generate a histogram (and blinkies) that more faithfully represents the data as recorded in the RAW file?" Or, put another way, "Can we teach the camera to start the blinkies when the image (or portions thereof) really is over-exposed and not before?"

Of course, the answer is "Yes!" Otherwise this would be a short post :D But, as in all things, there's a trade off that we'll get to in due course.

Here's an example of the problem. This is approximately how the images looks on the camera LCD (imagine that the red areas are really blinkies :D). Judging from this, one would dial back the exposure by at least a stop if not more to get rid of the blinkies.

1. 800, f/2.8, 1/10s
477458053_ENYJ9-M.jpg

This image, BTW, is completely usable, just dial back the exposure (no highlight recovery needed) and you have a decently exposed image. The point is that the camera is not telling the truth about this.

What I found in my reading, research, and testing is that these blinkies are really the result of the camera applying, in this case, the tungsten WB corrections to the data in the process of generating the JPG. Each of the factory WB presets will impart it's own bias and will cause the above effect to a greater or lesser extent. We need a Custom White Balance (CWB) that is neutral.

Here's what I did to generate that neutral CWB file:
  1. Go into the camera menus and set all the "presets" to Neutral
  2. Set camera to manual
  3. Set ISO to 100
  4. Set aperture to something, I think I used f/5.6. Doesn't really matter as you'll see in a moment :D
  5. Set shutter speed to something easy. I used 1/250
  6. Put the lens cap ON the lens!
  7. Take the shot. When you look at the result, it should be all BLACK!!! Cool, right?
  8. Select it for CWB. How this is done is different for each camera. Read your manual for the details.
Now the question becomes, "Well, how do we know that we have a neutral CWB?" The answer lies in reading the WB coefficients of the dark image. When normalized, they should be (1.0000, 1.0000, 1.0000, 1.0000). Oh, and the closer these numbers are to 1.0000, the better. But wait, there's four numbers there - I thought we were working in an RGB color space. Yup, but there a little filter over your sensor that filters the light. It's a mosaic of four colors in each "group"; one red, one green, another green one, and one blue. That accounts for the four numbers.

I downloaded (from here) the ExifTool by Phil Harvey. Running this against the dark frame CR2 file using the command:
exiftool.exe -WB_RGGBLevelsAsShot img_2452.cr2
produced the results
WB RGGB Levels As Shot          : 1031 1031 1031 1031
Pretty good!

You remember the shot above with all the blinkies? Well, this is a shot under the same conditions and same settings. Only difference is that I used the above generated CWB.

2. 800, f/2.8, 1/10s
477458055_JVz29-L.jpg

OK, now you know what the trade-off is. You can never, during a shoot, show your clients the images on the back of your camera! They'll think you've gone mad, pull the funding, and kick you to the curb as a poser. Not a goodness!

But, note that there aren't any blinkies! And, the histogram shows the same thing. Even better, during testing, I altered the shutter speed to 1/8s and got some minor blinkies. In post, these turned out to represent blown channels. So it seems to work.

When processing these images, one would set the appropriate WB (that's what the gray target is for) and dial back the exposure a bit - in this case about -0.95 in ACR - remember the idea is to expose as far to the right as possble without blowing a channel. The result is

3. 800, f/2.8, 1/10s
477467300_Dwygt-L.jpg

BTW - no other adjustments were made to the images, no curves, saturation, noise reduction, anything. Oh, and no animals were injured during the testing. He may have been bored, but no injured:lol

The bottom line - As long as
  • one can get over the sickly green color of the image on the LCD and
  • one has the time to take multiple exposures to push right up against the right wall of the histogram
we can now "Expose to the Right" and KNOW that we haven't gone too far, just by looking at the blinkies and the histogram. This shows you where you lattitude is and what it's limits are - no more guessing! When shooting a bride in a bride and groom under mid-day sun, she in her white gown and him in his flat black tux - you'll KNOW that you didn't blow out her gown. That's a money maker!

Comments

  • Options
    kdogkdog Administrators Posts: 11,681 moderator
    edited February 20, 2009
    VEEERRRRRYYY interesting, Scott!! clap.gifclapclap.gif


    I do have one question though. I believe you said that the camera applies the tungsten WB corrections to the data in the process of generating the JPG. So are you saying it does this regardless of the camera's WB setting? If so, are you also saying that using a custom WB setting overrides the camera's selection of tungsten for figuring blinkies and histogram data? But the factory WB presets (cloudy, shade, etc), don't do that? headscratch.gif

    Thanks and regards,
    -joel
  • Options
    Scott_QuierScott_Quier Registered Users Posts: 6,524 Major grins
    edited February 20, 2009
    kdog wrote:
    VEEERRRRRYYY interesting, Scott!! clap.gifclapclap.gif


    I do have one question though. I believe you said that the camera applies the tungsten WB corrections to the data in the process of generating the JPG. So are you saying it does this regardless of the camera's WB setting? If so, are you also saying that using a custom WB setting overrides the camera's selection of tungsten for figuring blinkies and histogram data? But the factory WB presets (cloudy, shade, etc), don't do that? headscratch.gif

    Thanks and regards,
    -joel
    Sorry, I wasn't as clear as I would have liked to have been. I had the camera set for the factory tungsten WB because that was the light under which I was shooting (I also tried it with AWB, just for grins). I have re-worked that portion of the post to better communicate this. Thanks for pointing it out to me - good catchthumb.gif

    Each factory WB setting will impart it's own bias to the photo; each bias will impact this observed effect to a greater or lesser extent. The thing is, none of the factory WB presets are free of bias. They are there because they closely "match" the various types of light commonly encountered.
  • Options
    kdogkdog Administrators Posts: 11,681 moderator
    edited February 20, 2009
    Each factory WB setting will impart it's own bias to the photo; each bias will impact this observed effect to a greater or lesser extent. The thing is, none of the factory WB presets are free of bias. They are there because they closely "match" the various types of light commonly encountered.
    Ah! Much mo' betta. Awesome find here, Scott. bowdown.gif Thanks again for a great post. deal.gif

    Cheers,
    -joel
  • Options
    divamumdivamum Registered Users Posts: 9,021 Major grins
    edited February 20, 2009
    What I have to know: did you pick your (very lovely) dog because s/he is a perfect bride-and-groom practice target with all that black and white?! :D (beautiful spaniel!! thumb.gif)

    Very interesting info, Scott - thanks for writing it up! thumb.gif
  • Options
    Scott_QuierScott_Quier Registered Users Posts: 6,524 Major grins
    edited February 21, 2009
    divamum wrote:
    What I have to know: did you pick your (very lovely) dog because s/he is a perfect bride-and-groom practice target with all that black and white?! :D (beautiful spaniel!! thumb.gif)

    Very interesting info, Scott - thanks for writing it up! thumb.gif
    That dog is my wife's problem.:lol I had nothing to do with the decision. Were it up to me, the household pet would be that artifact from the 70's and 80's - a pet rock! Don't get me wrong, I like animals and I like Merlin (that's his name). I just have no particular use for a pet.
  • Options
    michswissmichswiss Registered Users, Retired Mod Posts: 2,235 Major grins
    edited February 21, 2009
    That dog is my wife's problem.:lol I had nothing to do with the decision. Were it up to me, the household pet would be that artifact from the 70's and 80's - a pet rock! Don't get me wrong, I like animals and I like Merlin (that's his name). I just have no particular use for a pet.

    You've found a good use for the pet in this post. Who, or what would have been the subject otherwise?

    I'll need to try this technique soon myself. Thanks! bowdown.gif
  • Options
    SFGfxSFGfx Registered Users Posts: 33 Big grins
    edited February 22, 2009
    Wow! Thanks a lot! I just tried this and it works really well, even though I shot jpeg and not raw. And yeah, sickly green on the LCD. Yuck! :puke1

    Question though. My test shot had gray speakers in it that worked pretty well. But what if you don't have something that is neutral gray? Find something as close as possible in the image, I guess?
  • Options
    Scott_QuierScott_Quier Registered Users Posts: 6,524 Major grins
    edited February 23, 2009
    SFGfx wrote:
    Wow! Thanks a lot! I just tried this and it works really well, even though I shot jpeg and not raw. And yeah, sickly green on the LCD. Yuck! :puke1

    Question though. My test shot had gray speakers in it that worked pretty well. But what if you don't have something that is neutral gray? Find something as close as possible in the image, I guess?
    You need something you know is a neutral. For those not yet clear on the concept, that means something white, gray, or black - but not all the way white or all the way black. A good neutral gray is best.

    If you don't have one in the scene, then you need to put one there - hence the WB target in my examples. If your would rather not have a gray target in your shot, put it in there for a shot, then take it out and repeat the shot. Then, in post, get the WB settings from the first and apply them to the second. Easy stuff.

    FWIW, to date, I hav seldom run into a situation in the wild (weddings and street) where I have not been able to find a suitable "natural" gray target that gets the WB very, very close. If it's off a touch, then you eye-ball it the rest of the way.
  • Options
    SFGfxSFGfx Registered Users Posts: 33 Big grins
    edited February 23, 2009
    Scott,

    Thanks again. I've done some more tests using raw without a neutral gray "something" in the shot and have gotten great results just eyeballing it.

    I've got this set up in my camera as my custom WB and will be using it regularly. (Except when someone wants to chimp. Can't have them seeing that!!)

    I can't say it enough: Thank you, thank you, thank you!! wings.gif

    Mike
  • Options
    Scott_QuierScott_Quier Registered Users Posts: 6,524 Major grins
    edited February 23, 2009
    SFGfx wrote:
    Wow! Thanks a lot! I just tried this and it works really well, even though I shot jpeg and not raw. And yeah, sickly green on the LCD. Yuck! :puke1
    Just to re-visit this point.

    This technique provides no benefit (over what your camera already does) if you are shooting jpg. This technique is all about dtermining when the image recorded has areas that are blown - getting the histogram to better reflect the content of the RAW data. The histogram, regardless of the WB being used, reflects the data in the JPG image - whether that JPG image is your final product or only the JPG embedded in your RAW file.

    So, if you are shooting JPG, you are MUCH better off getting an CWB that reflects the lighting conditions as this will minimize the amount of adjustment that needs to be made in PP. Because you have so much less data to work with when dealing with JPG files, you want to minimize the amount and scope of adjustments made to them.
  • Options
    Scott_QuierScott_Quier Registered Users Posts: 6,524 Major grins
    edited April 27, 2009
    It's been two months since I "converted" to this way of working with CWB. In that time, I've shot one wedding, two Operation:Love Reunited sessions, one head-shot session, and a maternity shoot.

    First things first - I'm not advocating that this is the way people should shoot. There's lots of reasons why this is not for everyone ... I'll leave the listing of most of these reasons "as an exercise for the student."

    For me, the single biggest reason NOT to use this technique is if you intend to show the camera LCD images to a client who may not have 100% trust in your abilities (for those, I shoot a couple of test shots with an "appropriate" WB, show those, reset, and get on with business).

    So, what are my feelings/impressions after having shot somewhere between 3,000 and 4,000 frames using this CWB? For me (YMMV) it's almost all positive with very little in the way of detractors. I like to expose as far to the right as possible (given lighting and the limitations that places on shutter speed, etc) and correct the exposure in post (since I'll be doing that anyway) to get as much data as possible in the first two or three stops. Using this technique, I know that the histogram is doing a very good job. When it says, I've over-exposed, I have. If it says I have room before over-exposing, I do. I've encountered very few, if any, false readings.

    The one other detractor for me is I need to make sure I have a neutral from which to set the WB later. Usually this isn't an issue. When in doubt, I make sure I get a shot of my WB target.
  • Options
    silversx80silversx80 Registered Users Posts: 604 Major grins
    edited April 27, 2009
    Interesting, but I'm curious if this applies to using the RGB histogram. My Olympus gives me the option of using the luminance histogram, which will sometimes lie, and the RGB, which will allow me to see if I've blown out an individual channel. What I get from the camera is usually pretty well replicated in PSE6 and CS3.

    I'm guessing it might be a brand issue as well. Olympus only leaves about 1/2 stop of highlight headroom between RAW and jpg, while Canon and Nikon, for example, leave roughly 1-2 stops.
    - Joe
    http://silversx80.smugmug.com/
    Olympus E-M5, 12-50mm, 45mm f/1.8
    Some legacy OM lenses and an OM-10
  • Options
    Scott_QuierScott_Quier Registered Users Posts: 6,524 Major grins
    edited April 27, 2009
    silversx80 wrote:
    Interesting, but I'm curious if this applies to using the RGB histogram.
    That's a question I've not considered. My working assumption has been that the luminance histogram would show blown out if and only if one or more the seperate RGB channels was blown. But, I don't know, through direct testing, that my assumption holds.

    In fact, I can think of only one way to do direct, systematic testing of this assumption. Use red, green, and blue gels (for example, in front of the lens), in turn, to restrict the color of light reaching the sensor and set exposure to blow out that channel. Does one get the blinkies and a luminance histogram showing the blow out? Wouldn't be too difficult to do this if one has a Roscoe sample deck, some cardboard, and a little tape ... oh, and a little time.
  • Options
    ZarathustraZarathustra Registered Users Posts: 92 Big grins
    edited April 27, 2009
    Thank you for the information, Scott! I'm going to have to try this out in the field. I shoot Sony (no comments from the peanut gallery) and when I go off of the histogram I always have to boost the exposure by .5 in post to get a properly exposed picture. I just tried your CWB idea and sure enough, I get an extra 2/3 stops before the blinkies show up. The pic on the back of the LCD is atrociously green but I think that it will come in very handy. You, sir, are a god among men!
  • Options
    Scott_QuierScott_Quier Registered Users Posts: 6,524 Major grins
    edited April 27, 2009
    Thank you for the information, Scott! I'm going to have to try this out in the field. I shoot Sony (no comments from the peanut gallery) and when I go off of the histogram I always have to boost the exposure by .5 in post to get a properly exposed picture. I just tried your CWB idea and sure enough, I get an extra 2/3 stops before the blinkies show up. The pic on the back of the LCD is atrociously green but I think that it will come in very handy. You, sir, are a god among men!
    deal.gif - let's be real careful with that "god" business and not get carried away. Just ask some of my friends - we don't want this going to my head too.

    Second - I want to be the first to say that I know relatively little. What I do know, I've learned here or other places - lots of reading. I try to post only what I have actually done and demonstrated to work - at least for me. If it helps others - well that's great and my intent ... in the spirit of pay it forward.

    That green LCD image can have a number of benefits. For example, say you're out shooting with a group and you want to be left alone - just let the most gossip inclined individual see your photo. He (or she) will spread the word that you have no clue what you're doing and, all of a sudden, you have time to get your work done. :lol :lol4
  • Options
    ZarathustraZarathustra Registered Users Posts: 92 Big grins
    edited April 27, 2009
    I hate to admit it, but even without the green cast on my LCD that "rumor" spreads about me fairly quickly. eek7.gif
  • Options
    Scott_QuierScott_Quier Registered Users Posts: 6,524 Major grins
    edited April 28, 2009
    I hate to admit it, but even without the green cast on my LCD that "rumor" spreads about me fairly quickly. eek7.gif
    Yeah, me too:D
  • Options
    kdogkdog Administrators Posts: 11,681 moderator
    edited April 28, 2009
    That's a question I've not considered. My working assumption has been that the luminance histogram would show blown out if and only if one or more the seperate RGB channels was blown. But, I don't know, through direct testing, that my assumption holds.
    Sorry, Scott. That assumption doesn't hold. The Luminance histograms use pixel values that are a weighted average of its three color channels. And the weighting is towards green. That makes it real easy for example to blow out the reds in a sunset while your luminance histogram optimistically shows lots of headroom left. My landscape photography improved significantly once I realized that, and I always use RGB now. Here's a good article on the subject (note that what we call RGB histograms are actually referred to color histograms in this article): http://www.cambridgeincolour.com/tutorials/histograms2.htm
  • Options
    ziggy53ziggy53 Super Moderators Posts: 23,851 moderator
    edited April 28, 2009
    kdog wrote:
    Sorry, Scott. That assumption doesn't hold. The Luminance histograms use pixel values that are a weighted average of its three color channels. And the weighting is towards green. That makes it real easy for example to blow out the reds in a sunset while your luminance histogram optimistically shows lots of headroom left. My landscape photography improved significantly once I realized that, and I always use RGB now. Here's a good article on the subject (note that what we call RGB histograms are actually referred to color histograms in this article): http://www.cambridgeincolour.com/tutorials/histograms2.htm

    Unfortunately there is no industry standard for how histograms are created nor is there any agreement what data is necessarily used nor how it is represented.

    Here is my own informal relative comparison of several histograms:

    http://www.dgrin.com/showpost.php?p=666259&postcount=9

    My recommendation is to find out what the histograms in your own (as in "everyone's" own) cameras and software means with relation to your own work. Experience and understanding will reward you with more control in your workflow from acquisition through presentation.
    ziggy53
    Moderator of the Cameras and Accessories forums
  • Options
    kdogkdog Administrators Posts: 11,681 moderator
    edited April 28, 2009
    ziggy53 wrote:
    Unfortunately there is no industry standard for how histograms are created nor is there any agreement what data is necessarily used nor how it is represented.

    Here is my own informal relative comparison of several histograms:

    http://www.dgrin.com/showpost.php?p=666259&postcount=9

    My recommendation is to find out what the histograms in your own (as in "everyone's" own) cameras and software means with relation to your own work. Experience and understanding will reward you with more control in your workflow from acquisition through presentation.
    Ziggy, I agree that different histograms can be used in different ways. No argument there. But we're talking about a very specific case here, namely using the in-camera luminance histogram versus the in-camera RGB histogram in conjunction with exposing to the right.

    My point is that the in-camera luminance histogram uses a weighted average of the three channels, and cannot be relied upon to tell you if you've blown a channel. If that's important to you (and it is to me), then you should use the RGB histogram, and not the luminance histogram. That's true in Canon cameras that support both types of histograms as far as I know, and most likely in Nikons as well.

    There are numerous write-ups around the internet on this subject, and I've already referenced one above. Here's a link to another: http://www.sphoto.com/techinfo/histograms/histograms2.htm

    That's a very long article, so here's an excerpt: "Since a luminance histogram has had some perceptual compensation (unbalanced averaging) applied, it may not always show you if you have pixels in the 0 or 255 tonal area. "

    Seems pretty clear to me. Do you disagree with this?

    Thanks and regards,
    -joel
  • Options
    ziggy53ziggy53 Super Moderators Posts: 23,851 moderator
    edited April 29, 2009
    kdog wrote:
    ... Seems pretty clear to me. Do you disagree with this?

    Thanks and regards,
    -joel

    I suspect that we agree more than we disagree, but my caution is against "any" assumptions and generalizations because there are "no" standards regarding histograms. Without standards the minute you think you might be able to make assumptions is the same minute you can be misled.

    I've heard some rumors that some camera's luminance histograms contain "only" green channel information, based on the assumption that the green channel would clip first. The truth is there is not enough reliable information to ascertain one way or the other and the manufacturers are no help at all since they routinely omit any technical information regarding camera histograms.

    While it would seem that RGB histograms should be straightforward, since there is no standard we really don't know anything about linearity or clipping or value averaging or sampling rate or internal adjustments against RAW or ... anything.

    Trying to use a camera's histogram is a giant leap in faith and, by itself, a lesson in frustration. That doesn't mean we should disregard the histogram, it just means that we need to learn what the histogram means, as well as what it does not mean, and that can vary from camera model to camera model.

    I have 4 different types of Canon dSLRs and it would seem that they each have differences in how the luminance histogram interprets a scene.

    Why are there differences? This is digital technology and these histogram tests are against the same CR2 file. There should be no difference if they all use the same method of data sampling and interpretation.

    Granted the differences are not humongous but they should be identical since they are all from Canon cameras, yet they are not identical.

    Most troubling is how the camera histograms treat the clipped highlights, compared to how some software histograms show much more of the clipped data.

    Here are the images I snapped of the 4 histograms. (Look especially at the left 20 percent or so and notice what appear to be averaging and sampling discrepancies in the luminance histograms.)

    523824627_ekVxD-L.jpg
    523822916_KUJSG-L.jpg
    523823848_P2dVS-L.jpg
    523825357_CKmUD-L.jpg
    ziggy53
    Moderator of the Cameras and Accessories forums
Sign In or Register to comment.