tags:

views:

26

answers:

1

Hello,

I'd like to change certain color in an image on a webpage based on user selected color, it this possible using php or javascript.

if it not possible or will be difficult, how do i do it using flash?

please help me with sample code or website.

thanks

+1  A: 

You could set parts of the image as transparent and save it in a format that supports transparency. Then put the image inside a div and set the background-color CSS property of the div. This will only allow you to set one colour within the image, however.

tomit
hello, thanks for the tip. i thought of this before, but had troubles implementing it. which image format should i use, gif or png? is there anyway i could change at least two colors?
Smith
I would recommend png, as it was developed to improve upon the gif format. I suppose you could place multiple <div>s behind the image, in different places with different background-colors, but that will get messy fast.
tomit