Section 3: Brighten a Photograph by Manipulating the Histogram

If you read through the first two sections of this article, you hopefully have a better understanding of what histograms are, why they are helpful to photographers, and what they do and do not tell you about your photograph. In this section, we are going to introduce how something a simple as brightening a photograph can be viewed as a manipulation on the histogram of the photograph. To be clear, I'm trying to sell anyone on the idea that all photograph manipulations are just manipulations of the photograph's histogram (actually, it's easy to prove this is false). However, it is useful to understand what is going on with some manipulations by understanding how those manipulations operate on a given photograph's histogram.

In this section, we are only going to talk about what happens to a histogram when the photograph is brightened. In the next section, we will discuss how to actually perform the manipulation on the photograph's histogram by making use the curves filter available in Adobe Photoshop.

Brightening an Photograph

As already stated, we are going to consider what happens to a photograph's histogram when we perform the simple manipulation of brightening the photograph. Brightening an image can be a simple matter of multiplying the pixel values of every pixel in the photograph by some constant value greater than 1. Darkening an image can be accomplished in the same matter, except that one would multiply all the pixel values by a value less than 1. For the sake of this example, we will be brightening an image by multiplying all of the pixel values by 2. For example, a pixel value of 50 will become a pixel value of 100, a pixel value of 75 will become a pixel value of 150, and so on. In other words, 10% grey becomes 20% grey, 15% grey becomes 30% grey, and so on.

Black and white image of Foellinger Auditorium at the University of Illinois at Urbana-Champaign.
Figure 1: Black and white image of Foellinger Auditorium at the University of Illinois at Urbana-Champaign.

To illustrate this, let's look at the black and white photograph and its associated histogram in figure 1. Two lines have been added to the histogram, one red and one blue. The red line simply marks the halfway point in the histogram (i.e. 50% white = 50% black = pixel value 127). Since we are multiplying the pixel values by two, we are particularly interested in the half-way point. Any pixel value that is greater (brighter) than the half-way point will end up becoming greater than the maximum possible pixel value of 255 after it is multiplied by 2, and thus clipped (maxed out) at a pixel value of 255. The blue line roughly follows the shape of the histogram for pixels at 50% grey and darker.

Brighter version of the photograph in figure 1.
Figure 2: Brighter version of the photograph in figure 1.

Figure 2 is the same photograph as in figure 1, except that all of the pixel values have been multipled by 2. Because we have multiplied all the values by 2, all of the pixels that originally had a pixel value greater (brighter) than the half-way point are now maxed out at the highest possible pixel value of 255. Notice that the right most column is very high compared to the rest of the columns in the histogram in figure 2 (this is why the rest of the columns look shorter compared to the histogram in figure 1).

Also note that the histogram in figure 2 has many empty columns. In fact, every other column is empty. This is because when you multiply any whole number (integer) by 2, you will end up with an even whole number. Therefore, all of the columns that represent the odd pixel values (i.e. 1, 3, 5, 7, and so on) will be empty after the operation has been applied.


This effect becomes more pronounced as we brighten the image more and more using this method. For example, say a picture was really dark and all of the pixel values in the original image fell somewhere between 0% and 10% grey (pixel values 0 to 25). One might say, let's just multiply all the pixel values by ten so we make use of the full range of greyscale values. However, consider what the result will be: 1 will be mapped to 10, 2 will be mapped to 20, 3 will be mapped to 30, and so on. In the final image, there will be no pixels with values that are not a multiple of 10 (e.g. 17, 45, 51). In other words, the resulting image will be brighter, but may also look posterized depending on how noticeable this effect is (more noticeable with a greater multiplier).

Non-Lenear Effect of Using Whole Numbers for Pixel Values

Depending on the value you are multiplying the pixel values by, another effect can take place. For example, consider multiplying the pixel values by 1.5. To explore what would happen, let's consider three pixel values: 100, 101, and 102. 100 multiplied by 1.5 is 150 (a whole number). 102 multiplied by 1.5 is 153 (also a whole number). However, 101 multiplied by 1.5 is 151.5 (not a whole number). Since the resulting pixel values must be whole numbers (at least when they are finally stored in an image file), the factional poriton of the value 151.5 (i.e. the ".5") must be removed. In other words, the value of 151.5 must either be rounded up to 152 or rounded down to 151. Either way, this has a non-linear effect on the result. The original values were 100, 101, and 102. Those values are equally distance from one another. However, the results will no longer be equally distant from one another: 150, 151, and 153 if we round down or 150, 152, and 153 if we round up. For the most part, this non-linear effect resulting from the use of whole numbers being used to represent pixel values won't be noticed by people viewing an image. However, as more and more filters are applied to a given photograph, especially when those filters have larger and larger effects, the amount of error introduced from such small non-linear effects can begin to grow rapidly if one is not careful.

In the next section of this article, we'll explore how to actually perform a manipulation on a photograph's histogram by using the curves filter in Adobe Photoshop.

next >>