Change PNG Color using Javascript/jQuery and CSS Change PNG Color using Javascript/jQuery and CSS javascript javascript

Change PNG Color using Javascript/jQuery and CSS


Trick 1

Have multiple images already created (using photo editing software such as Gimp or Photoshop) and simplly change the image source using jQuery.

Trick 2

Another option is to have a PNG with transparent heart-shapped hole in it and change the background colour using jQuery.


You can't.

What you can do is replace it with the unicode text character for a heart and set the colour of that.


Make two images and use the CSS Sprites technique to change the image color when user clicks/hovers/ etc.. you can customize as you want. See the link for simple tutorial on creating the CSS Sprites.