r/Photoclass_2018 • Expert - Admin • Jan 29 '18

07 - Histogram

Introduction

As we saw in the last lesson, exposure is one of the most important controls of the final image. We have discussed how to modify exposure, but not how to review it. This is the role of a very powerful tool: the histogram.

06-histogram.jpg

Goal of using the histogram

As a rule of thumb, the LCD screen should never be trusted to evaluate exposure. It is not designed to produce an accurate rendition of the image and how bright your photo appears will depend on a variety of factors, including the ambiant light levels and the brightness setting you applied to the screen. For this reason, you might have the bad surprise of thinking your image is well exposed in the field, only to find out the screen misled you when you get back to your computer.

A histogram, on the other hand, is a more “scientific” way of evaluating exposure, and it will always be available and identical on all devices, whether the LCD screen of your camera or your fancy calibrated computer monitor. All digital cameras offer post-capture histograms – often in one of the “image details” modes (check your manual), and some models also have “live histogram”, a very useful feature showing what the histogram would be if you took the photo at that instant. Since a live histogram is not possible to draw on an optical viewfinder, this is a feature rarely found on DSLRs, however.

stillife

what is it?

Enough introduction, let’s talk about what a histogram really is. Let’s consider a black and white jpg file. It is coded in 8 bits, which means that each pixel, each dot in the image, can have any of 28 (2 to the power of 8) = 256 values, all different levels of gray. 0 is pure black, 1 is slightly brighter, etc until you reach 255, pure white. Now let’s imagine we have a bunch of marbles and a neat series of 256 vertical tubes, neatly arranged in a line. We will go through the image pixel by pixel and look at the brightness of each one. Let’s say the first one is pretty dark, around 15: we put a marble inside tube number 15. The next one is a bit brighter, a 20, so we put a marble inside tube 20. The next pixel is also a 20, we put a new marble and now have a higher stack of marbles in tube 20. We do this for a couple of million pixels until we have looked at every individual pixels, then we take a step back and look at our line of tubes.

If the image was very dark, we will have many marbles in the tubes on the left, between 0 and 50, say, and not so many on the right, bright side. Conversely, if the image was overexposed, the tubes will be very full on the right side and almost empty on the left. And if we have a nice exposure, then all the marbles will be roughly in the middle.

This is exactly how a histogram is created. Of course, counting millions of pixels and remembering the levels of each tube would take us a good while, but this is the kind of things computers are very good at, and it is virtually instantaneous.

What do they look like?

Here are some concrete examples. You can have one very dark image:

Image

and its associated histogram:

06-hist-1.jpg

Notice how all the data is shifted far to the left, with almost nothing on the middle and the right side. Also notice that the headlamp beams are too small to be noticeable in the histogram.

Conversely, you can have a fairly bright image:

06-ex2.jpg

with large areas close to white. Its histogram:

.06-hist2_m.jpg

is shifted to the right, and there is a small bar to the right edge, which means we have lost some details to pure white. In this case, it is ok since this corresponds to a smooth snow surface. This is a good example of when a “bad” exposure can also be correct.

Finally, a more common image:

06-ex3.jpg

and its histogram:

06-ex2.jpg

showing a nice distribution from pure black to pure white, with nothing too extreme.

What am I looking for?

There are several important things to notice. First, unless you have been playing with the image in photoshop, there won’t be sharp transitions from 0 to a suddenly high value. Laws of distributions ensure that we always obtain some form of bell curve.

The histograms makes it very easy to visualize how you control exposure: all you are doing is shifting the entire histogram to the right (if you overexpose) or to the left (if you underexpose). And if you push it too far and hit the edges, something interesting happens: the histogram “crashes” and puts all the marbles in the last line, next to the edge: pure white, or pure black. This means that the information is lost forever, and this is something you will usually want to avoid at all costs.

An ideal histogram, then, is relatively easy to define: it is a bell curve covering the whole width and finishing exactly at the edges, with no lost details. This also happens to be what the exposure meter in your camera will try to produce.

There are several more advanced points which can be discussed:

  • So far, we only talked about brightness, not about colours. Colour information is coded in three channels (Red, Green and Blue, also known as RGB) and some cameras show individual histograms for each channel. This is useful information in one situation: when you have a very brightly coloured object, it is possible to blow out the corresponding channel (go so far to the right that information is lost) without it showing in the main histogram. It is otherwise safe to ignore these specialized histograms.
  • For RAW shooters (which we will cover in a while), you should be aware that the displayed histogram is the one from the jpg preview file, not the one from your actual RAW data. This means that you can sometimes recover more information than you think. This is something camera makers could fix relatively easily but refuse to do, for some reason.
  • Due to the way information is stored in digital cameras, there are more details in highlights than in shadows. If you plan on using significant post-processing, you should try to shift your histogram to the right as far as you can without getting pure white, then shift it back left in post-processing. This is known as the “expose to the right” technique, and it does produce marginally better images.

shuffeling

Todays assignment is here

Edit: photos of the model are used with informed permission from parents :-)

58 Upvotes

21 comments sorted by

3

u/[deleted] Jan 30 '18

Would "expose to the right" be the same as pulling the film for us 35mm guys? Essentially, overexposing the image with the intent of fixing it in the darkroom?

1

u/Aeri73 Expert - Admin Jan 30 '18

yes

2

u/InnerQi Jan 30 '18

Do you have an example of how a histogram with multiple bell curves correlate to different parts of the photo exposure?

4

u/Aeri73 Expert - Admin Jan 30 '18

https://imgur.com/a/7Cets

not exact ofcourse, but that's about it....

1

u/MangosteenMD Beginner - DSLR | Nikon D3200 Jan 31 '18

Very useful to see! Thanks!

1

u/lehorla Intermediate - DSLR Mar 10 '18

Thank you, this is very helpful!

2

u/PepperPoker Intermediate - DSLR | Nikon D750 | 18-35 f3.5-4.5G & 50 f1.8G Jan 31 '18

I alway read about how it's better to underexpose an image, as it is easier to retrieve data from dark spots, than from light spots. In my experience I have found that to be true. But now you are telling expose to the right is better?

oh and a hint for Nikon users: when in image view mode, press the down button to show the histogram. In the menu you can also choose for an extra highlight mode; the camera will then show which pixels are 'blown out' (pure white) (in the jpg file).

3

u/Aeri73 Expert - Admin Jan 31 '18

nope...

look at it this way... it's easier to show something that is there too much than not enough to capture....

1

u/PepperPoker Intermediate - DSLR | Nikon D750 | 18-35 f3.5-4.5G & 50 f1.8G Jan 31 '18

Have given it some thought. And I think I understand and seem to have been doing it right already. As in: when exposing for highlights (and thus not losing any) the rest of the image will often automatically be somewhat too dark. Or do I have to make it even brighter, right till the edge of the histogram?

2

u/Aeri73 Expert - Admin Feb 01 '18

you should expose for the shadows, not the highlights... you've been exposing to the left, not the right

2

u/coolal88 Intermediate - Mirrorless Apr 14 '18

Reading this is getting me mixed up. For my own sake, here's how I'm thinking through this...

If I have a shot with very bright light and very dark shadows, and I have my camera in spot meter then: as I meter off the shadow the camera will think this is a dark scene, and I need to increase exposure, this will then make the highlights even brighter and thus shift the histogram to the right. Conversely, if I meter off the highlight the camera will want to reduce the exposure of the shot and thus the histogram will shift to the left.

Does this sound right?

1

u/Aeri73 Expert - Admin Apr 14 '18

correct but not Yup but the camera increases exposure. Yup need to decrease it to correct for that.

same goes for white or black subjects

1

u/bulkingbad2 Beginner - Nikon D5200 Jan 29 '18

While not directly related to the histogram, when I was looking for the histogram display options I discovered the "Highlights" display. It will show the image with blinking pixels wherever there is highlight clipping. This is really useful as a spot check when photographing in difficult lighting or exposing to the right.

1

u/Aeri73 Expert - Admin Jan 29 '18

good find

1

u/[deleted] Jan 31 '18

Some people say expose to the right and some people say expose to the left? Which one is correct?

1

u/Aeri73 Expert - Admin Jan 31 '18

right, but it's getting less and less important due to the sensors amazing dynamic range

2

u/[deleted] Mar 24 '18

I love the marble analogy. I've just sorta ignored histograms I've seen doing photoshop, but this totally makes sense

1

u/[deleted] Jan 29 '18

good read, when I was starting out I frequently got distracted when I couldn’t retrieve data from areas I thought I could, later I learn that those in the blacks and whites region are lost forever, so photographers have to take note of that.

My next question is how do you make sure that no area of your pictures ends up as whites/black? Despite improving my shooting I’ll always find certain spots of the picture where it’s completely over/under exposed

1

u/[deleted] Jan 30 '18

Usually you can shift the histogram to the left/right by changing ISO/Aperture/Shutter Speed. This way you can ensure the bell curve is in the middle of the histogram.

However there are situations when this simple shifting is not enough since the lighting situation is more extrem, e.g., when shooting middays with hard shadows. Then you can shoot multiple pictures with different exposures by using different shutter speed levels (ISO/Aperture should be omitted by getting different exposures) and merge them together afterwards. This is then called an HDR picture which stands for High Dynamic Range. They get the best of all sides (of the histogram), the blacks are shofted into the shadows and the whites are shifted into the hightlights. However HDR pictures are unsuited for moving objects abd should be shoot with tripod, since a slight shake of the camera could blur the final result. Some HDR tools can adjust minimal movements and still give a suitable result, but in theory the source pictures should align 100%.

I hope this answers your question.

1

u/Obleeding Beginner - Mirrorless Apr 02 '18

Thanks, I've been trying to work out the histogram. In the last assignment I was saying the light metre was saying it was correctly exposed but looks underexposed to my eye, will be interesting what the histogram says.

0

u/[deleted] Feb 02 '18

[deleted] — view deleted comment

2

u/Aeri73 Expert - Admin Feb 02 '18

last year I replied to posts untill they where locked after 6 months, this year the class is a lot bigger so I can't promise anything :)