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
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.
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.