Skip to content
Related Articles

Related Articles

CSS | grayscale() Function
  • Last Updated : 08 Aug, 2019

The grayscale() function is an inbuilt function which is used to apply a filter to the image to set the grayscale of the image.


grayscale( amount )

Parameters: This function accepts single parameter amount which holds the value of grayscale. The value of grayscale is set in terms of number and percentage. The value 0% represents original image while the value in between 0% to 100% represents the linear multipliers on the effect.

Below example illustrates the grayscale() function in CSS:


<!DOCTYPE html> 
    <title>CSS grayscale() Function</title
        h1 {
        body {
        .grayscale_effect {
            filter: grayscale(100%);
    <h2>CSS grayscale() function</h2>
    <img class="grayscale_effect" src
        alt="GeeksforGeeks logo"


Supported Browsers: The browsers supported by grayscale() function are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Safari
  • Opera
My Personal Notes arrow_drop_up