Skip to content

CLAHE local contrast

Equalize local histograms while limiting how much a concentrated bin can amplify contrast.

Try it on your image ↓

VISUAL WALKTHROUGHColour
REFERENCE INPUTLow-contrast image

The same scene stays here while the working view changes.

RESULTInterpolate local mappings

Four neighbouring tile mappings blend bilinearly. Contrast grows locally without hard tile seams.

STEP 03 / 03

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

YOUR IMAGE · REAL OPENCV

Experiment at pixel level

Open full lab ↗

Equalize grayscale locally while clipping excessive histogram peaks.

The engine loads on your first run. Your images stay in this browser.

Input448 × 320
OutputWaiting for a result

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
Hover to inspect. Click to pin a pixel.
Input
Select a pixel

Output
Select a pixel

Sample models and licenses

When to use it

Reveal detail under uneven illumination without the strongest noise amplification of unrestricted local equalization.

How it works

  1. 01Split the image into tiles and build their histograms.
  2. 02Clip large bins and redistribute their excess counts.
  3. 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.