I have this image in my website, is a png:

I want to know if there is any way with HTML5, javascript or css to change the color of the image. Or at least make the image change to white (invert color black to white, not the transparency).
|
I have this image in my website, is a png:
I want to know if there is any way with HTML5, javascript or css to change the color of the image. Or at least make the image change to white (invert color black to white, not the transparency). |
||||
|
|
|
I'm not sure this belongs on GD, but... It can be done using HTML5's
BUT YOU DON'T WANT TO DO THIS! Problems:
You can save CPU cycles for you and your users by just creating the colors you need server-side (there are scripts that can do this for you) and serving them the colors they need. You only want to use Similar questions have also been asked on SO a few times: |
|||
|
|
I've done this kind of thing in the past by placing the "after" image behind the "before" in z-order and just changing the alpha on the front image. |
|||||||||||||||||
|
|
This works very good on almost any browser.
I hope it works for yuor project. |
|||||
|
|
There doesn't seem to be any easy way to do it. If you need 2 pngs you could use css sprites. |
||||
|
|