Converting an Image to White in CSS

Converting an Image to White in CSS

  • CSS
  • 1 min read

You can convert an image to white in CSS using the filter property. Below are the examples:

CSS Filter Property

The filter CSS property adds graphical effects to an element, such as blur or color shift. Filters are frequently used to alter the appearance of images, backgrounds, and borders.

Example: Converting an Image to White in CSS

Apply the following filter CSS to your image to convert it to white.

filter: brightness(0) invert(1);

Or assign a class to your image, for example, turn-white and use the following CSS:

.turn-white{
   filter: brightness(0) invert(1);
}