illumgray
Estimate illuminant using gray world algorithm
Syntax
Description
estimates the illumination of the scene in RGB image illuminant = illumgray(A)A by
assuming that the average color of the scene is gray.
estimates the illumination, excluding the specified bottom and top percentiles of
pixel values.illuminant = illumgray(A,percentile)
estimates the illumination using name-value arguments to control additional
options.illuminant = illumgray(___,Name=Value)
Examples
Input Arguments
Name-Value Arguments
Output Arguments
Tips
The gray world algorithm assumes uniform illumination and linear RGB values. If you are working with nonlinear sRGB or Adobe RGB images, use the
rgb2linfunction to undo the gamma correction before usingillumgray. Also, make sure to convert the chromatically adapted image back to sRGB by using thelin2rgbfunction.When you specify
Mask, the bottom percentile and top percentile apply to the masked image.You can adjust the color balance of the image to remove the scene illumination by using the
chromadaptfunction.
References
[1] Ebner, Marc. "The Gray World Assumption." Color Constancy. Chichester, West Sussex: John Wiley & Sons, 2007.
Version History
Introduced in R2017b
See Also
chromadapt | illumpca | illumwhite | lin2rgb | rgb2lin

![Figure contains an axes object. The hidden axes object with title White-Balanced Image Using Gray World with percentiles=[10 10] contains an object of type image.](../../examples/images/win64/CorrectWhiteBalanceUsingGrayWorldAlgorithmExample_02.png)
