A histogram is a very common tool used for editing photos, in photoshop and lightroom it gives users a quick view of how their photo’s values are distributed (some digital cameras also display a histogram).
The image histogram actually just displays a graph of how many pixels with each value appear, usually split into all three colors. Using the canvas imageData method its very easy to create a histogram. Basically its a matter of looping through the pixels, keeping track of how many appear at each value and then rendering out a graph.
I did it here. (only tested in webkit). In this example I never actually display a canvas, I use it to extract image data and then pass the dataUrl to image nodes. Canvas is awesome.