illumgray
Estimate illuminant using gray world algorithm
Syntax
Description
illuminant = illumgray(A)A by
                assuming that the average color of the scene is gray.
illuminant = illumgray(A,percentile)
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 using- illumgray. Also, make sure to convert the chromatically adapted image back to sRGB by using the- lin2rgbfunction.
- 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)
