BrightnessEqualize
✖
BrightnessEqualize
uses the correction model given by flatfield, which models the variation in brightness across image.
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
.
- Possible settings for either flatfield or darkfield include:
-
val a constant value val corrimage a 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:
-
n an n-degree polynomial f,params,vars an arbitrary model f with parameters params and variables vars - The following options are available:
-
Masking Automatic the regions to use for model estimation PerformanceGoal Automatic aspects 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.

Examples
open allclose allBasic Examples (1)Summary of the most common use cases
Scope (7)Survey of the scope of standard use cases
Data (3)
Equalize a grayscale image of a scanned document:

https://wolfram.com/xid/0k77q04868l80-dsousb

Adjust brightness in an unevenly illuminated color photo:

https://wolfram.com/xid/0k77q04868l80-d0kvqh

Adjust brightness of a 3D CT scan image:

https://wolfram.com/xid/0k77q04868l80-kbtbcx

Parameters (4)
Remove uneven illumination in a microscopy image by estimating the brightness distribution:

https://wolfram.com/xid/0k77q04868l80-lzehxr
Fitting a multivariate polynomial of first order on the entire image domain:

https://wolfram.com/xid/0k77q04868l80-j0xc0

Using a second-order polynomial:

https://wolfram.com/xid/0k77q04868l80-thkva

Fitting second-order univariate polynomials to the image marginals in each direction:

https://wolfram.com/xid/0k77q04868l80-mmwx8t


https://wolfram.com/xid/0k77q04868l80-dy11i3

Remove a vignette effect by fitting the lightness channel to a given model:

https://wolfram.com/xid/0k77q04868l80-3fdnvg
Assuming a rotationally symmetric, radial-dependent vignette:

https://wolfram.com/xid/0k77q04868l80-xagx2e


https://wolfram.com/xid/0k77q04868l80-6r7whd

Perform a subtractive correction on an astronomical image by estimating the dark field:

https://wolfram.com/xid/0k77q04868l80-71r9lo

Options (1)Common values & functionality for each option
Masking (1)
By default, an automatic mask is used:

https://wolfram.com/xid/0k77q04868l80-jtf2mm

https://wolfram.com/xid/0k77q04868l80-o9d4js

Equalize brightness based on the image background:

https://wolfram.com/xid/0k77q04868l80-gc48l9


https://wolfram.com/xid/0k77q04868l80-6gbh1f

Applications (7)Sample problems that can be solved with this function
Achieve a constant luminosity of the Moon surface:

https://wolfram.com/xid/0k77q04868l80-00oqmx

https://wolfram.com/xid/0k77q04868l80-b4e5t6

Equalize brightness of a microscopy image:

https://wolfram.com/xid/0k77q04868l80-ybriqq

https://wolfram.com/xid/0k77q04868l80-ydlz3r

Equalize brightness distribution assuming a homogeneous background:

https://wolfram.com/xid/0k77q04868l80-uifl9u

Equalize color distribution by handling each channel separately:

https://wolfram.com/xid/0k77q04868l80-yohhw3

Remove uneven illumination from a scanned document:

https://wolfram.com/xid/0k77q04868l80-82cqsh
Create a mask to omit text in the subsequent equilibration:

https://wolfram.com/xid/0k77q04868l80-zxcuol

Equalize brightness distribution fitting a sixth-order polynomial:

https://wolfram.com/xid/0k77q04868l80-xpmzd6

This improves the text recognition result:

https://wolfram.com/xid/0k77q04868l80-x34x17

Equalize the brightness distribution without a mask applying a horizontal fit:

https://wolfram.com/xid/0k77q04868l80-puyhto

This also improves the text recognition result:

https://wolfram.com/xid/0k77q04868l80-blvhy0

Reduce the vignette effect of a photograph:

https://wolfram.com/xid/0k77q04868l80-3o5jjy
Compute a mask for the background that is expected to have even illumination:

https://wolfram.com/xid/0k77q04868l80-gjfqjd


https://wolfram.com/xid/0k77q04868l80-cnvg48

Remove CCD artifacts from an image taken by a low-quality camera with many pixel defects.
Flat-field image of the camera:

https://wolfram.com/xid/0k77q04868l80-mi6yvz
Microscopy image of a tear drop:

https://wolfram.com/xid/0k77q04868l80-jortea

https://wolfram.com/xid/0k77q04868l80-xxeskf

Correct uneven illumination in an MR scan:

https://wolfram.com/xid/0k77q04868l80-pze9w4
Use only muscle tissue for brightness estimation:

https://wolfram.com/xid/0k77q04868l80-blucig


https://wolfram.com/xid/0k77q04868l80-k3ee1n

Correct uneven brightness in a 3D magnetic resonance volume:

https://wolfram.com/xid/0k77q04868l80-h0nqnl
Note the reduced brightness toward the perimeter of the volume:

https://wolfram.com/xid/0k77q04868l80-sab1xl

Select the muscle tissue to estimate the brightness distribution:

https://wolfram.com/xid/0k77q04868l80-v3hz0a


https://wolfram.com/xid/0k77q04868l80-wr76u7

Estimate the brightness distribution by a polynomial in cylindrical coordinates of even orders up to 4:

https://wolfram.com/xid/0k77q04868l80-6hjdzm
Compare the initial volume and the result with equalized brightness:

https://wolfram.com/xid/0k77q04868l80-jzl7en

Wolfram Research (2017), BrightnessEqualize, Wolfram Language function, https://reference.wolfram.com/language/ref/BrightnessEqualize.html.
Text
Wolfram Research (2017), BrightnessEqualize, Wolfram Language function, https://reference.wolfram.com/language/ref/BrightnessEqualize.html.
Wolfram Research (2017), BrightnessEqualize, Wolfram Language function, https://reference.wolfram.com/language/ref/BrightnessEqualize.html.
CMS
Wolfram Language. 2017. "BrightnessEqualize." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/BrightnessEqualize.html.
Wolfram Language. 2017. "BrightnessEqualize." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/BrightnessEqualize.html.
APA
Wolfram Language. (2017). BrightnessEqualize. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/BrightnessEqualize.html
Wolfram Language. (2017). BrightnessEqualize. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/BrightnessEqualize.html
BibTeX
@misc{reference.wolfram_2025_brightnessequalize, author="Wolfram Research", title="{BrightnessEqualize}", year="2017", howpublished="\url{https://reference.wolfram.com/language/ref/BrightnessEqualize.html}", note=[Accessed: 22-March-2025
]}
BibLaTeX
@online{reference.wolfram_2025_brightnessequalize, organization={Wolfram Research}, title={BrightnessEqualize}, year={2017}, url={https://reference.wolfram.com/language/ref/BrightnessEqualize.html}, note=[Accessed: 22-March-2025
]}