Given an image and the task is to change the image color using CSS. Use filter function to change the png image color. Filter property is mainly used to set the visual effect to the image. There are many property value exist to the filter function.
filter: none|blur()|brightness()|contrast()|drop-shadow()|grayscale() |hue-rotate()|invert()|opacity()|saturate()|sepia()|url();
Example 1: This example use grayscale filter to change the colored image into grayscale image.
After applying filter:
Example 2: This example use many filter to the image.
- Change an HTML5 input placeholder color with CSS
- HTML | Change Background color using onmouseover property
- How to change an input button image using CSS?
- CSS | Animation to Change the Hover State of a Button/Image
- Convert an image into grayscale image using HTML/CSS
- How to change the thickness of hr tag using CSS ?
- How to change the height of br tag?
- How to get hex color value of RGB value ?
- How to change the element id using jQuery ?
- AngularJS | ng-change Directive
- CSS | 8 Digit Hex Color
- CSS | 6 Digit Hex Color
- D3.js | color.rgb() Function
- CSS | 3 Digit Hex Color
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.