Multiply each pixel in an image by a factor
As a basic optimization, it may save a little time if you create 3 lookup tables, one each for R, G, and B, to map the input value (0-255) to the output value (0-255). Looking up an array entry is probably faster than multiplying by a decimal value and rounding the result to an integer. Not sure how much faster.
Of course, this assumes that the values should always map the same.
I have an image that is created by using a bayer filter and the colors are slightly off.  I need to multiply RG and B of each pixel by a certain factor ( a different factor for R, G and B each) to get the correct color.  I am using the python imaging library and of course writing in python.  is there any way to do this efficiently?
Thanks!