CLAHE local contrast
Equalize local histograms while limiting how much a concentrated bin can amplify contrast.
The same scene stays here while the working view changes.
Each 6 × 4 tile gets a 16-bin histogram in this small example.
One tile’s bins are capped at three samples. The removed counts spread uniformly across all 16 bins, shown in orange, before forming the cumulative mapping.
Four neighbouring tile mappings blend bilinearly. Contrast grows locally without hard tile seams.
Interpolate mappings between tiles to avoid abrupt boundaries.
Computed teaching example on a 24 × 16 image. Small kernels and simplified settings keep each change visible; use the image laboratory for native OpenCV.
Try it on an image
Experiment at pixel level
Equalize grayscale locally while clipping excessive histogram peaks.
The engine loads on your first run. Your images stay in this browser.
Scroll over either image to zoom at the pointer. Use the scrollbars to pan both views over the same relative area. Zoom is relative to the input; pixel coordinates belong to each image. Warps can change scene correspondence.
Pixel inspector RGBA · native values · matched scale · 9 × 9 output pixels
Select a pixel
Select a pixel
When to use it
Reveal detail under uneven illumination without the strongest noise amplification of unrestricted local equalization.
How it works
- 01Split the image into tiles and build their histograms.
- 02Clip large bins and redistribute their excess counts.
- 03Interpolate mappings between tiles to avoid abrupt boundaries.
local histogram → clipped distribution → interpolated mapping
What to tune
clipLimit controls clipping; tileGridSize sets the number of tiles, not their pixel dimensions.
Where it breaks down
It can still amplify noise and create unnatural contrast. Work on a suitable luminance channel when preserving colour matters.
TypeScript API
Open an entry for its exact overloads, parameter descriptions, result ownership and pinned upstream source.
All of these calls execute on the CPU. Native objects need explicit disposal. See matrices and ownership and build compatibility.
Related methods
Histogram equalization
Redistribute grayscale intensities using their cumulative histogram.
Colour-space conversion
Re-express pixels in a different channel order or colour representation.
Colour range masks
Keep pixels whose channel values all lie within specified lower and upper bounds.
White balance
Estimate channel gains or mappings that reduce an image’s illumination colour cast.