If I click on the image, it should change the color of a part of the image. Then I want to replace the image. Can this be done with javasript? Help me.
If you mean changing the color of a clicked pixel, this is not only possible with JavaScript. But you can get coordinates and pass them to PHP script. In PHP, you can change the image.
If I didn't get it, I think you could place a transparent image over the image you wanted to change, thereby changing the appearance of the image. I think I did something like this with prototype once.
As far as changing the color, yes it can be done, you could probably cook something with SVG as well as Canvas element and JavaScript using your image.