Sunday, 1 June 2014

Understanding the histogram

This applies both to the histogram that your camera probably can display and to the histogram in your favourite image processing tool - in my case Lightroom.

First up, the camera, mine is capable of displaying one of two histograms, one of them shows the overall light in the image and the other shows the same thing but in the three colour channels in which the device operates, red, green and blue.

Lightroom's histogram shows the colour spaces as well as highlight and shadow. A couple of people on g+ asked me to write this tutorial, I've agreed to do it on the basis that it will help me to further understand the histogram. To ensure I have complete understanding I've referenced the manual for Lightroom 5. I'm not going to go into huge detail because I don't want to overwhealm the new histogram user, if you need more information the reference manual is available from adobe for free download.

First up, lets look at the histogram, it's a fairly simple device to people familiar with graphs. On camera the histogram is generally read only and will look somewhat similar depending on your device.

Let me borrow some text from the LR manual to describe the histogram because I think they did it so well "A histogram is a representation of the number of pixels in a photo at each luminance percentage. A histogram that stretches from the left side of the panel to the right side indicates a photo that takes full advantage of the tonal scale. A histogram that doesn’t use the full tonal range can result in a dull image that lacks contrast. A histogram with spikes at either end indicates a photo with shadow or highlight clipping. Clipping can result in the loss of image detail."

Ok, first lets talk overall about what you're seeing

How do cameras see colour? Before we get into the histogram, there is an important concept we need to first talk about. Your camera does not see colour the way you do, for each sensor element (or pixel if you prefer although that's not strictly true but good enough for this purpose) there are three sensors, one measures the amount of red light, another green light and another blue light. The three measurements together can be used to make up any colour within the gamut of the device to recognise, encode and store. Cameras see colour in eight bits (and ONLY eight bits) per colour, this means each of the three colours Red Green and Blue (RGB) can store values between 0 and 255. 0 means that there is no colour of that part of the spectrum at that location of the image and 255 means that there is an overwhelming amount of that colour.

Much like mixing paint colours the RGB measurements are mixed to produce the image you look at through computer logic. The RGB values are stored within a RAW file. Encoded RGB values with clever compression techniques are also stored in JPEG, PNG and other formats.

You've probably seen bits described elsewhere in the imaging detail of your camera of eight, ten, twelve, fourteen and sometimes as high as sixteen. This bit number does not change the eight bit nature of RGB but it does change the width of the histogram - the tonal range that the device can capture and understand.

The best analogy I can think of is a picket fence. A picket fence which has a gap between each picket might be considered eight bit tonal range. A higher resolution picket fence would have a smaller gap and a so on until you reach a fence that is solid with no gaps between the pickets that defines a perfect utopia of sensor technology that we are a long way from today.

Clipping Warnings: there are two arrows on the top left and top right of the histogram. They represent the clipping warning controls and they are on off switches or buttons. The default to on. Clicking on one with your pointer turns them on and off. The left hand side governs warnings about loss of detail in shadows and the one on the right governs warnings about loss of detail in highlights.

Black Clipping: this warning will show as bright blue dots or shaded areas of your image. It is a warning letting you know that at current histogram levels too much of the image is totally black (RGB values of 0, 0, 0). This will also show as a peak in the left column of the histogram visual display.

In this image the warning is coming in part of a grape vine in shadow.

White Clipping: We often see this in the sky of images or around other bright sources of light, it means that you've lost detail because there has been too much light for sensor to record effectively in this area. This shows up as bright red dots or shaded areas of your image.

This warning is coming in sky that is simply too bright where the exposure has been for the landscape ignoring the sky.

I might note these clipping errors and the limited tonal range of camera sensors is the reason behind the somewhat laborious techniques of increasing the tonal range including blending multiple exposures, tonal mapping of single or multiple images and high dynamic range (HDR) techniques.

What does the graph mean?

Well to understand that we need to delve back into the colours, the graph is a sampling across your image and again to quote the LR manual is "representation of the number of pixels in a photo at each luminance percentage". So what does that mean to you as the photographer? Well it means that LR has sampled the image and worked out based on the space it has to show you the histogram how many pixels there are of each of the available horizontal points on the graph. Simple huh? No... ok as each colour in each of the spots gets brighter the graph will be higher. Where there is no light it will flat line along the bottom. Where there is too much light it will flat line across the top.

The graph shows in the three colours red, green and blue with a shaded area for each. Where the colours overlap the graph changes. Grey means that all RGB overlap at that position, yellow appears when red and green overlap, magenta where red and blue overlap and finally cyan when green and blue overlap.

Within Lightroom in Develop mode (as of version 4 and continued into version 5) the histogram is divided into areas representing blacks, shadows, exposure and highlights and whites.

Each section shows the corresponding area affected by the exposure sliders in the panel below. Each of them affects overall the height of the graph, or more correctly a percentage range of the pixels.

You can adjust the amount of pixels that fall into each area using either the sliders or by dragging the boundaries of the five histogram areas to expand the tonal range attributed to that area of the light.

So what do I do with it?

Well, now that is a good question, we now know that for a standard image it is desired to have all of the graph from left to right to peak as high vertically as possible. However, this is for a standard image. If you lived in Kodak world of some time back this would be a bright sunny day with an image shot around f/11 of a beautiful landscape with every colour in the rainbow present and accounted for in all the possible shades. The brainiacs of workshops and courses will often tell you it must cover the whole tonal range. I really don't think so. First up, compare the graph with the image itself. You can see that the majority of the exposure is off to the left of the image meaning there is loads of detail in the blacks, shadows, midtones, but that the highlights and whites are lacking. This is quite normal because this is an image that is predominantly grey. So there should not be a lot of highlights and whites.

Most of us probably shoot in other conditions including artificial light and we shoot images of widely varying subjects. The image from the graph used in the five areas above is a an example of an acceptable image, not an exiting image, but acceptable and would I change the histogram - not in this case, but we will explore what happens when we do.

First up, lets drag the histogram over to the right by pulling the right boundary of the section labelled Exposure to the right of the image.
This has resulted in a significantly brighter image, it's certainly less dull than the image above, however, as a documentary image it is now lacking because it's harder to read the inscriptions.

Where this modification would come into its own is if we were planning on  doing further conversion of the image to monochrome or indeed if printing it. The first image would have been quite unacceptable printed but the second would be better.

Should I do this to all of my images?

Of course you should. Well, no, ok you shouldn't. I'm going to run through a bunch of example image that I find acceptable and show you their histogram. As you can see the histogram varies wildly from image to image. The first rule of thumb is look at the image. It should be evident to you if it needs to be darker or lighter in general to match your memory of the subject.

Ok in this image, the histogram is telling us we've got a lot of blue in the highlights and that there is a mix of red and green in the mid tones of the exposure and there is a modicum of colour in the shadows and blacks.

This is an acceptable histogram. There is no clipping. This is a well exposed image for the subject matter.

When I first encountered this image, there was some clipping within the blacks so I did drag that area slightly to the right into the shadows which cured the clipping and improved the image contrast in these areas.

In this image which is mostly a green subject, not surprisingly there is a lot of green. There is a minor clipping warning on the green channel shown on the right hand side and one in the magenta channel on the left.

I haven't altered this image from the exposure I captured because I don't think it needs it despite the slight clipping.

This church in Warrnambool exposed by tungsten street lighting really does need some attention. We can see from the histogram there there is very little representation of colour except in the blue channel (sky is blue, even in the dark!). There is major clipping in the blacks and a lot of areas with highlight and white clipping. 

These warnings give us the starting point to fix this image, but before I did that, I'd fix the white balance and straighten and crop the image. This way we'd be working on the histogram only for the image parts we want to keep.

There is no doubt in my mind the best place to fix histogram issues is in camera, that's why you camera can display it. In this image I've got a model looking at an atlas face down on a carpet of leaf matter from the sequoia grove that she's in near Warburton. The image is obviously underexposed. Sam is illuminated by some small LED flood lights and a gold reflector. I was trying to hand hold so could not do a lot about the exposure without losing depth of field as my shutter speed was already down around where I'm comfortable hand holding. The only way to go further would have been to use the tripod but then Sam might move. In the end I compromise. There is an enormous amount of detail in the shadow areas as displayed in the histogram and some detail in the mid tones but there is near nothing in the highlights and whites.

To attempt to remedy the image, I dragged the histogram shadows into the mid tones and dragged the mid tones into the highlights.

This has had a brightening and positive effect on Sam herself but in the background it has made an enormous amount of noise visible that would be need to be tidied up through softening.

The lesson here - don't always work just on the histogram, I'd be better off using local adjustments to adjust Sam and the atlas only bringing them up and leaving the shadows dark. Afterall Sam is the subject not the shadows behind her.

So, as a general rule, forget the general rule and adjust in ways that suit the image and more importantly your vision of what you want the image to be.

A lazy man's guide to processing images of people in Lightroom with my top 10 simple tips

Ok, so you've got your collection into Lightroom. Well done, congratulations you've taken a big step to managing your collection as a whole. In this article, I'm going to walk you through my LR process which is about both managing the catalogue and applying simple post processing to enhance my images where they need it. In this particular example, I'm going to use an image of Sam shot in less than optimum light on a grey misty day on the outskirts of a forest late in the winter afternoon. This particular session is centred around processing an image of a person.

First up, you really don't need any special tools apart from LR itself. There are plenty of them and I've tried many. You've got to be really careful with the tools that "fix" faces, they often leave your subject looking like a barbie doll. Your subject isn't going to want to see that spot that appeared during the shoot but neither is she going to want to look like a plastic doll. Go easy.

The rest of this guide is for people like me who have some idea of what they want to do, but the plethora of controls more complex than the pilots console in a 747 befuddle you...

Ratings as a method of catalogue management

First up, I've got a bunch of similar images here, to minimise both my work in post processing but also to avoid over sharing on social networking I want to come down to one or two of this set to look at further. So to work out which one I'm going to concentrate on I'm going to review each of the similar images and rate it from 1 to 5 where 1 is worst and 5 is best. This is probably my number 1 tip in using lightroom or any catalogue software for that matter.

Tip 1: Using ratings helps you find things later.

Using ratings along with your other meta data you can answer searches such as find me the best images from the shoot with Sam at Warburton in the forest. Your location and model meta data and keywords help with most, but the ratings are the only thing that can help with "best".

How do you rate them? Well it's subjective, but you can introduce some objectivity, I see it as 1 means I really don't like the image, perhaps its got a serious technical fault (e.g. out of focus or too slow a shutter speed making it blurred) and 5 means I really love the image and am completely proud of the outcome. In this case, this is a shoot of a person so I will also consider if I've captured the essence of the person and ensure I've not captured anything that unfairly detracts from her appearance from my own positioning. If I was using flash I would also be looking for things like catchlights in her eyes (a positive) and reflections of equipment (a detraction).

You select the image you want to rate from the filmstrip (quaint name but hey it works) of images that pans horizontally across the screen below the main window and press one of the number keys 1, 2, 3, 4 or 5 to rate the image. This will show up as a grouping of stars.

In this case I've rated the centre image higher that the companions because of a few factors, the composition fills the frame, yet the off centre of the umbrella stops it dominating Sam and it gives the impression of implied nudity which makes the viewer want to see more and search your image with their eyes. As you can see from the other two Sam was very much dressed and her expressions and pose are very similar. There's nothing wrong with the other two so they got three (above average) and the centre image got four.

So lets process the image

The lighting of the day wasn't very friendly to colour and I remember that Sam isn't pasty, she has lovely skin tones and that umbrella is quite vibrant (like it's owner Fran). So how do we tackle this to bring the images back to what we remember on the day, well sometimes I use colour cards in test images and sometimes I wing it. In this case I'm winging it (mostly because I left my colour cards at home).

First up, we need to change from Library mode which is about managing images to Develop mode which gives us access to the copious controls to modify an image. To do this you can press the d shortcut key (every key does something in LR) or you can click on the word Develop with your pointer. The word Develop will highlight to show the current mode.

Tip 2: Learn at least the basic short cut keys, they will save you loads of time

Now that we're in develop mode, I'm going to change from the default single view of the image I'm working on and minimise the film strip and left hand panel to devote the most room on the screen to the image. I do this by clicking the little arrows around the sides of the screen on the left and bottom sides. They're circled in red below.

Tip 3: Get as much room as possible for your image while working on it

Now your view changes so that your image is centre stage on the screen and considerably bigger than it was before. To get the panels back, just click the arrow again, or hover over it to bring it back temporarily so you can use a feature from that panel then move the pointer away to make it drop away again.

Tip 4: Before and After View helps you to know when to stop processing

The next thing I'm going to do is click on the little box with YY in it which will open the image in a before and after window. I find this very handy to see where I'm going with the image. It helps me know when to stop so I don't over process the image.

Alright, now we're ready to begin. The first thing I noticed with this image is that its quite dull. Fortunately I shoot in raw, so this is easy to fix, you shoot in RAW right? If you don't, then please consider it as it gives you the best opportunity to correct your images in post processing if they need it. Shooting directly into JPEG means that you're often limited in what you can accomplish afterwards.

Tip 5: Always shoot in RAW

Now that we are ready to move forward on this image, I'll make the gross changes first, then finalise with the subtle changes afterwards.

Tip 6: Use the tools that affect the image overall first, then narrow down to the subtle tools

The first thing I'm going to do is set the white balance to Cloudy, sometimes this is all you need for an image shot on a dull day. By the way, did you know that when shooting in RAW on your camera the camera's white balance setting actually means nothing? All it does is affect the preview JPEG embedded in the RAW. You can change it to anything you want afterwards (remember Tip 5?).

The tool to change the white balance is high lighted in yellow and circled in red, simply click on it and choose the value you want from the list. Try all of them, can't hurt in Light room you can always undo everything you've done on a RAW file (remember tip 5?) by selecting from the Settings Menu the option Reset All Settings. A lot of people never use this because in my opinion it's poorly named, to me it doesn't talk about a photo it talks about the software.

Tip 7: You can always undo what you've done in Lightroom so experiment!

The image is already looking a little better, but the change is fairly subtle. Sam's skin tones have become more normal for her skin and her hair and lips have popped a little. There is still more to do. The next thing I'm going to tackle is the clipping in the shadows. I've got clip warnings turned on for shadows and highlights, I think this is the default in LR but if it's not turned on in your copy just click the two little arrows that are top left and top right in the histogram.

While we're here, you can see that the histogram shows that this image is still a little flat, by this I mean the range of peaks is concentrated to the left of centre of the image, this image should be brighter than it is because the highlights are flat lined. I'm going to deal with this a little bit in this image, but not all the way because I actually want the darker look for this one.

Tip 8: The histogram opens a window into the image exposure and allows you to adjust it for the result you want to achieve

To deal with the clipping I'm going to bring up the shadows, until most of the bright blue warning dots vanish, in this case up to +43. I do this by grabbing the slider and dragging it to the right

Not only are the blue warning dots gone, but Sam herself as come up a bit more too. Not far enough yet, and the colours of the umbrella are still quite boring compared to what they should be. So we'll keep going. Using the same method I'm bringing clarity up +19 and vibrance up +57 which is a lot, but with this image it works out nicely - how do I know when to stop, while sliding slowly I watch Sam's face skin tones - after all I'm trying to rescue the umbrella but she is the important part of the image, so it needs to be right for her.

Tip 9: Watch the most important part of the image while adjusting and make that part right

We still aren't there yet and we've also made the whites of Sam's eyes blue, we'll fix that later. You'll notice a little bit of the clipping has come back too, but not enough to worry me, there is still plenty of detail in the shadows.

Next up, I've played with the Hue | Saturation | Luminance panel, in this case particularly the hue. These sliders work just like the others we've touched and in this case change the nature of the colour in the image. There isn't really much science to the way I use this panel, I really do just play until I like it. I do have some knowledge of colour that I've built up over time and by experimentation (tip 7!) have learned what effects the sliders have. 

Ok, I'm nearly happy with this image now, but remember those blue eye areas that should be white, we're going to fix them next.

First up, I'm going to zoom into the area of Sam's eyes and work on them using the zoom tool. This is the default pointer tool in Develop mode when there are no other tools selected. Just click the pointer where you want the zoom to be centred.

You can see the blue eyes quite clearly in this image, there are a lot of ways to deal with this including reducing blue overall in the image but I want to keep the same blue that is in the umbrella. I'm going to cheat a little bit and I'm going to use the local adjustment brush and paint in some desaturation - not because it's the best way, but because it's the quickest way I know of to achieve what I want to do. 

Tip 10: The local adjustment brush helps you make changes to small areas of an image without affecting anything else.

The local adjustment brush tool is the small paint brush with a halo of dots and is highlighted in this image. It's used to change small (or large if you're patient) areas of the image without affecting it overall.

In this case I'm going to reduce the saturation, so I'm preselecting that using it's slider in the panel below the brush that opened up when I clicked my pointer on the brush.

This will allow me to paint in the change of less colour into the areas that I want in the image.

In the close zoom I can also tell I've pushed the magenta up too much, but I'll deal with that after I've done her eyes.

Now that I've selected what I want, I simply paint over the areas I want to change (you might need to select a small brush - I always have it small).

By painting over the areas of Sam's eyes that were blue I've made them white again in a simple way. I haven't changed the rest of the image. Now to deal with that over blown magenta. I'll keep the image zoomed in and go back to the HSL tool and simply slide that magenta slider back a little to the left until it looks right. To do this I have to close the adjustment brush, I do this by just clicking my pointer on it again.

I've brought the magenta slider back down to +33 and I'm now quite happy with the image overall as it feels like nice skin tones in the way I remember Sam to be. The previous steps I've done have highlighted one aspect of Sam that I imagine she would rather not be there, there are a couple of spots on her forehead that have become more visible so I'll make them go away.

Bonus Tip: You can easily remove small marks out of your image, be they sensor spots or be they skin spots of some kind using the spot removal tool.

First up, use the zoom tool to zoom in and centre the image to the place you want to work on, then click on the spot removal tool to open it's palette up.

Click the highlighted tool with your pointer and set the size to be only just bigger than the feature you want to remove then click on the spot and magic it will vanish, you can adjust the source point for the image copy if you need to by moving it with your pointer. This tool uses a content aware fill of sorts which is fantastic for small areas. For larger areas I'd still do it in Photoshop even though you could use this tool for it. It's finicky and in PS it's easy so guess what inner lazy man wins.

Now we've got the final image that I'm happy with. There are some other areas that I could change, but in the size I publish on social media lazy man wins again. If I was making a large print of this image I would also deal with the blue tones I introduced by forcing the blues up earlier near Sam's eyes but on the screen you only see it because I just told you about it. You couldn't see it before could you?

One last thing I do when I export an image that I'm happy with is mark it as a "pick" by pressing the p key either in Develop mode or by highlighting the image in the filmstrip and doing it. This places a flag on the image to help you find the ones you've edited later. I also set the caption in the meta data of the image so that social networks such as Google+ will pick up the text and automatically use it for the photo caption when you upload it.

Now let me show you why I use flags and ratings... It's very simple really... let's say a couple of years from now Sam contacts me and says, remember those shots we did in the forest, I really liked that one of me with the umbrella, can you send it to me. Well, that's not a hell of a lot of information to find an image when you make on average 50,000 of them each year... well, meta data is the answer. I go to the catalogue and I select to search by pressing ctrl-f for find in Library mode. Then I set my search criteria...

I set the keyword to Sam and the attributes to flagged and rated > 4 stars. Guess what, that 50,000 images just turned into three in a few seconds and there it is. I can also see by the search outcome that I did a better job on changing the first image than the one I used for this tutorial. I could go back and fix all the steps here, but guess what lazy man wins again. I have fixed the image itself and you'll see Sam in her glory above.

Extra Bonus Tip: Your complete image history is available for you to show what changes you've made.

If you're doing a photography course or undertaking VCE Studio Arts (or HSC Studio Arts in other parts of Australia - we Victorians love being different for no reason) you can use the content of this panel with your submission to show the experimentation and final changes you made in the order that you made them. You can also remove individual changes but that's a bit out of scope for this session!

This tool shows not only the changes that you have made using individual controls, but also breaks down the changes made by the clustered controls that affect a lot of other parts of the image such as changing the white balance to Cloudy changed all sorts of things. This will help you understand what those clustered tools actually do.
Last of all, happy learning and I hope this brief tutorial has been useful for you.