adjusts the brightness across image, correcting uneven illumination.


uses the correction model given by flatfield, which models the variation in brightness across image.


uses the dark environment model given by darkfield.

Details and Options

  • Local brightness adjustment is also known as flat fielding, and is used for removing image artifacts caused by nonuniform lighting or variations in sensor sensitivities.
  • BrightnessEqualize works with arbitrary 2D and 3D images, adjusting the lightness channel in the LABColor space.
  • A flatfield image is an image of a homogeneous signal like a plain well-lit white background. A darkfield is the same image obtained without lighting. The flat fielding of an image with an object in the same setting is given by (image-flatfield)xMean[flatfield-darkfield]/(flatfield-darkfield).
  • Possible settings for either flatfield or darkfield include:
  • vala constant value val
    corrimagea correction image (rescaled to the image dimensions)
    {scope,model}fit the data into a given model
  • The default flatfield consists of a 2nd order polynomial fit. The default darkfield is assumed to be 0.
  • Using {scope,model}, the flatfield or darkfield is estimated by fitting a function.
  • The scope parameter specifies whether to fit the entire image data or the image projections along each axis. Possible settings include:
  • "Global"fit the entire image to the model
    "Marginal"separately fit model to the projections along each axis
  • The model can be one of the following:
  • nan n-degree polynomial
    f,params,varsan arbitrary model f with parameters params and variables vars
  • The following options are available:
  • MaskingAutomaticthe regions to use for model estimation
    PerformanceGoalAutomaticaspects of performance to try to optimize
  • Using Masking->Automatic, over- and underexposed pixels are not used for the adjustment.
  • With partially transparent images, the alpha channel is multiplied with the mask.


open all close all

Basic Examples  (1)

Equalize brightness of a plain texture:

Click for copyable input

Scope  (2)

Options  (1)

Applications  (8)

Introduced in 2017