OK, forget all the other words and lat me rephrase it like this:
I want to ask the website-user for a color. If the user says: red, I want the brown to become red. That's it.
One solution I thought of myself is to make the image an inverse (make the brown transparant) and then put it in a cell and change the background of the cell. The color of the image (now brown) will then become red. However: If I make a cell with a backgroundcolor, I will no longer see the background of the page through the image (between the brown now/ the red then). Get it? If you do not understand this part of the description, forget it.
The question is just: How can I make the brown --> red, using code online (Java/ php...)