A histogram counts how many pixels fall at each brightness. Its shape tells you if the photo is dark, washed-out, or well-exposed — long before you look at the image. Equalization re-spreads those pixels across the full range and rescues low-contrast shots that look flat.
Push brightness up — the whole histogram slides right and pixels bunch up against 255 (clipping to white). Crank contrast — the histogram stretches from the centre outward, spikes at 0 and 255 grow, subtle mid-tones vanish. Read the histogram, and you can already tell what a photo looks like without seeing it.
Every pixel votes for one of 256 bins based on its brightness. Pile of votes on the left → dark photo. Pile on the right → bright/overexposed. Tall spike at 0 or 255 → clipping (info destroyed). Wide, even spread → good exposure. You can diagnose an image before ever seeing it, just from the shape.
Sort pixels by brightness, then rank them 0…N. Map each pixel's brightness to its rank-percentile times 255. Result: every intensity ends up used equally often. This is what "equalize" literally does — makes the histogram as flat as possible using the cumulative distribution as the mapping.
Plain equalization uses one curve for the whole image — good for a uniformly dark photo, bad for a scene that's dark on one side and bright on the other (the bright side gets crushed). CLAHE breaks the image into small tiles, equalizes each locally, and interpolates. Result: shadows and highlights both come out with detail — the technique medical imaging and dashcam pipelines rely on.
A hospital sends you a chest X-ray where subtle details are hidden in the mid-grey mid-tones — the important structures are only visible after enhancing local contrast, not global. Which technique fits?