Detect image's overall brightness
Posted: 2008-05-22T10:04:00-07:00
Hi all,
I would like my slate generator to be able to draw text over a variety of images, and want to automatically set my fill color to WHITE when the image is overall dark, and BLACK when the image is overall light.
Is there a way to detect the overall brightness of the image (assuming that my backgrounds are going to be fairly uniform without a lot of variation in brightness) so that I can programatically make this choice?
Many thanks,
Steve
I would like my slate generator to be able to draw text over a variety of images, and want to automatically set my fill color to WHITE when the image is overall dark, and BLACK when the image is overall light.
Is there a way to detect the overall brightness of the image (assuming that my backgrounds are going to be fairly uniform without a lot of variation in brightness) so that I can programatically make this choice?
Many thanks,
Steve