Skip to main content
BVDART Logo
← All guidesFilters & transforms

Thresholding

Thresholding assigns pixels to low or high values according to a tonal decision. The threshold can be global, estimated from a histogram, or adapted to a local neighborhood.

Split a histogram or follow a local threshold

Unevenly lit marks
Marks on a shaded background
Binary decisionT = 125
Thresholded marks
Split the brightness population
Histogram with the selected threshold0255

Otsu chooses T = 88 by maximizing between-class variance, using the complete 256-bin histogram. The chart groups 8 levels per bar.

White pixels385 / 1536
Otsu threshold88

Sweep a global cutoff, then compare Otsu and local means on the same unevenly lit marks. Use any control to take over.

What to try
  1. Move the fixed threshold, then let Otsu choose the histogram split.
  2. Increase the illumination gradient and switch to local mean; vary its neighborhood radius.
Open in the Lab ↗

What to look for: A global threshold uses one value everywhere. The local curve follows the changing background, and each pixel compares with its own local mean minus 5.

How it works

A fixed threshold compares every pixel with one cutoff. Otsu chooses a global threshold by separating the histogram into classes with low within-class spread. It is useful when the distribution supports such a separation, but is not an object-recognition method.

Adaptive thresholding compares each pixel with a local mean or Gaussian-weighted neighborhood minus a bias. It can handle uneven illumination differently from a single global cutoff. Neighborhood radius determines the scale considered local.

Use it in the Lab

Use Threshold before morphology for hard shape processing, or after a blur to suppress small changes. Set the output colors explicitly when a two-color result is part of the artwork.

Limits & distinctions

These tools use the Lab’s encoded-RGB luminance proxy and preserve source alpha. A two-color RGB result is not necessarily an opaque binary mask.

Sources & references

Guide updated