Histogram
A graphical representation showing the distribution of pixel intensities in an image. Used to objectively assess exposure, contrast, and tonal range.
An image histogram is a bar chart plotting pixel count (vertical axis) against intensity values (horizontal axis, typically 0-255 for 8-bit images). It provides an at-a-glance view of an image's tonal distribution, enabling objective assessment of exposure and contrast. Histograms appear in camera viewfinders, RAW processors, and image editing software as a fundamental diagnostic tool.
- Exposure assessment: A histogram skewed toward the left (shadows) indicates underexposure, while one skewed right (highlights) suggests overexposure. Values clipped at either extreme represent lost detail - blown highlights or crushed shadows that cannot be recovered
- Contrast evaluation: A narrow distribution concentrated in a small range indicates low contrast (a "flat" image), while a wide spread across the full range indicates high contrast. Histogram equalization stretches the distribution to utilize the full tonal range
- Per-channel analysis: Displaying separate histograms for red, green, and blue channels reveals color casts and white balance issues that may not be apparent in the luminance histogram alone
In image processing code, OpenCV's cv2.calcHist() computes histograms efficiently, while JavaScript developers can iterate over Canvas ImageData pixel arrays. Histogram equalization (cv2.equalizeHist()) and histogram matching are standard algorithms for contrast enhancement and tonal consistency across image sets.