Invert colors of an image in CSS or JavaScript Invert colors of an image in CSS or JavaScript javascript javascript

Invert colors of an image in CSS or JavaScript


CSS3 has a new filter attribute which will only work in webkit browsers supported in webkit browsers and in Firefox. It does not have support in IE or Opera mini:

img {   -webkit-filter: invert(1);   filter: invert(1);   }
<img src="http://i.imgur.com/1H91A5Y.png">