Histogram Function This analysis tool examines an image and graphs the occurence per channel of each value. The X axis of the Histogram corresponds to the numerical value of a pixel. The Y axis is the percentage of pixels per channel that have that value. The graph has nothing to do with the input pixel's original X or Y position in the image. Here are some examples: Example 1 A 256x256 8-bit black and white Ramp. Since we have equal amounts of the entire range of pixels, we get a solid white field. The orientation of the ramp has no bearing on the graph:
Example 2 A 256x256 8-bit (ugly) Color. Since the color is set to (about) .75 .5 .25, each channel exists at only one position in the Histogram:
Example 3 A 256x256 8-bit 4-corner Grad. Red's four corner values are: (1, .5, .5, .5), Green's are (0, 1, .5, .5), and Blue's are (.5, 0, 0, 0). This reflects that most of Red's value are around .5, ramping downwards to 1, and no value less than .5. In the Viewer, you can toggle through the different channels by hitting R, G, B, or C in that Viewer.
Example 4 We now add a Brightness of 2 in between the Grad and the Histogram. We have also toggled on the Histogram parameter of maxPerChannel to see our results better. The result (the image is zoomed in here) is that we have no odd values (all numbers are multiplied by 2), so we have a gap at every other value. It is a tell-tale sign of digital alteration when you see such regular patterns in a histogram.
image Histogram( image, int width, int height, int ignore, int maxPerChannel );
image = Histogram(image, width, height, ignore, maxPerChannel);
shake -histogram width height ignore maxPerChannel
|