2
$\begingroup$

I have an image source emitting yellow light. Of course, when taking a picture with the light, the image has yellowness overall. How can I remove that color of light from the image? I have another picture of only background with the yellow light. Is there any way to subtract the image from the former one? Thanks

$\endgroup$
4
$\begingroup$

Do you want to remove the Yellow backgorund or make the Yellow light white?

If you want to color correct the image so that Yellow appears white then simply measure the R,G,B values of 'yellow', calculate the ratio between them. Then scale all the pixels in your image by that ratio.

Typically you would assume that green = brightness and just calculate red/green and blue/green then scale the red/blue pixels and just scale green to leave the overall brightness unchanged.

See http://en.wikipedia.org/wiki/Color_balance

$\endgroup$
3
$\begingroup$

The operation you need to perform is called white balance or color balance. Several algorithms are described in the article. An important proviso is that the light source be approximately white, not merely have a low color temperature. If it really is off-white you might need a more sophisticated solution.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.