Invert colors of an image in CSS or JavaScript

后端 未结 4 498
慢半拍i
慢半拍i 2020-12-12 15:53

How do I invert colors of an image (jpg/png..) in either css if possible or javascript?

Previous related questions don\'t give enough detail.

4条回答
  •  北海茫月
    2020-12-12 16:14

    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);
       }

提交回复
热议问题