Okay sure, you're interested in maintaining percieved brighteness. One source I knew of on wikipedia, has the following for a function of perceived brightness:
30% of the red value, 59% of the green value, and 11% of the blue value
You're right that this puts red at close to half the perceived brightness of green.
However, there are still things to consider. How light of a green would you still want to convert to red? For example, would you want to convert 254 - 255 - 254 to something like 255 - 254 - 254 ?
Note that I can't yet tell what you want to do with the existing red channel. For the conversions any of us have thought of so far, it looks like swapping (and scaling) the red and green components would work.
A formula comes to mind:
Code:
NewRed = max(OldGreen * 59 / 30, 255);
NewGreen = OldRed * 30 / 59;
Now, how well does this do for you? What does it do that is not desireable such that we can tweak it further (or replace it)?
Byt the way, what were you wanting to do with pixels that were already reddish?