In realtime? No not possible.
Simply because you have to do it for every pixel manually and you can not use images, only pixmaps / backbuffer.
The only way having such an effect in realtime is using shaders and let the GPU doing it straight "on the data" instead of working on a RAM replica of it that need to be reuploaded again.
What you can do thought is not use a 3 channel picture at all :)
Use 3 images. One for each channel, filled with grayscale values where the color shall be drawn and by what amount and masked out the rest. Now just draw them and use the SetColor to colorize them with the final color you want them to be drawn.
That indeed would work realtime and depending on what you wanted to do, it will even work very good.
But you see that your media must be created for this special use.
Simply because you have to do it for every pixel manually and you can not use images, only pixmaps / backbuffer.
The only way having such an effect in realtime is using shaders and let the GPU doing it straight "on the data" instead of working on a RAM replica of it that need to be reuploaded again.
What you can do thought is not use a 3 channel picture at all :)
Use 3 images. One for each channel, filled with grayscale values where the color shall be drawn and by what amount and masked out the rest. Now just draw them and use the SetColor to colorize them with the final color you want them to be drawn.
That indeed would work realtime and depending on what you wanted to do, it will even work very good.
But you see that your media must be created for this special use.