Before I begin, let me define the context. My explanation for the histogram is made on gray scale model of colors.
So I started to understand histogram analysis on black and white pictures.

• For a computer to represent one pixel it needs to know the position of that pixel and the color of that pixel.
• Because in this example we use gray scale images, the color of the pixel is a tone of gray.
• An 8-bit image means a pixel that can have 2^8 = 256 possible values for defining the tone.
• The histogram is a way to define how many pixels I have for each tone.
• On the x-axis we have the tones values, 256 possible values, and on Y-axis we have the number of pixels for each tone.

Example:
A picture entirely gray.
Gray tone has value 128 – is in the middle between 0 (that is black) and 256 (this is white) on the x – axis.
The histogram will show a spike in the middle of the graph showing the number of pixels for gray tone:
x =128 = the gray color is between 0 and 255.
y = number of all pixels that is also the size of the picture, because all pixels are same color.
So, for a picture 10 pixels by 10 pixels, the size of the picture is 100 pixels. A gray 10×10 image will have a histogram showing a spike in the middle (128 value). The size of the spike will be 10×10=100 pixels, which is the total number of pixels in that image.

If I have a picture 10×10 half of it white and half of it black, then the histogram will show 50 pixels for black tone ( x = 0) and 50 pixels for white tone ( x = 256). So, one spike of hight 50 for tone 0 and one spike of 50 for tone 255.

Another example: a gray gradient on a square picture like below, will show this histogram:

This was made in GIMP using a square picture and applying a gradient from Black to White between lower left corner and upper right corner.

The histogram is showing me a triangle with the top at value 128 – gray color. The red line is the longest line that has the same color of pixels. The histogram is counting how many pixels does the red line has. (that is pythagora theory: radical base 2 of 10^2×10^2 = > 100 pixels)

The histogram is just a counter for how many pixels of a specific tone (color) there is in a picture. How is this information helpful to me ?

By looking at a histogram without an image attached to it, artistically speaking there is not much information about what it contains. It can tell me properties of contrast, if is high or low contrast for example but other that that is just a guess. Trying to construct an image using the histogram would not help, because different images can have same histogram. It will not tell me the position of each pixel, but will tell me the number of pixels for a particular tone or color. A histogram with an image attached it can tell me for example if that image is overexposed or underexposed.

The examples below show three types of exposure: Under exposure – Correct Exposure – Over Exposure. Watch the histogram on the right how it is modified. For under exposed pictures, the histogram is showing that the colors are between black and gray, never reaching full white.