I want to create an image which I can use as a texture in OpenGL. The image is a jpg that comes in red.
In my OpenGL I want to be able to change the red color to any other color the user selects, for this i thought the best solution was just to discard the rgb channels from the original image and only use the alpha channel of the texture, and the rgb the user selected.
The problem is that even thought I have tried for quite some time, this only seems to work for the edges of the image, not the inner part of the image.
This is the example image:
As it can be seen, there are parts that are in pure red, others that are mixed with white, and complete white parts. I need to have "a png alpha image" in where white represents transparent. This means that complete red will have an alpha of 1.0, complete white an alpha of 0.0 and anything in between an alpha between 0.0-1.0.
In OpenGL I have access to the r,g,b,a channels of the texture. So if anyone has another solution that doesn't use alpha that would help too.