Editor's Draft · filter-effects

Filter Effects

6 properties, 11 functions, 1 type defined by this specification, 17 of them known to at least one browser (the others are badged Not in any browser yet).

Each feature in detail

backdrop-filter

Property Baseline: newly availablesince September 2024 Modern CSS: backdrop-filter

MDN The backdrop-filter CSS property lets you apply graphical effects such as blurring or color shifting to the area behind an element. Because it applies to everything behind the element, to see the effect the element or its background needs to be transparent or partially transparent.

Live preview Example from MDN
.example-container {
  background-image: url("https://developer.mozilla.org/shared-assets/images/examples/balloon.jpg");
  background-size: cover;
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: black;
}

#example-element {
  font-weight: bold;
  flex: 1;
  text-align: center;
  padding: 20px 10px;
  background-color: rgb(255 255 255 / 0.2);
}

Syntax

none | <filter-value-list>

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
none
Applies to
All elements. In SVG, it applies to container elements without the defs element and all graphics elements
Inherited
no
Percentages
n/a
Computed value
as specified
Canonical order
per grammar
Animation type
see prose in Filter Effects 1 § 14. Animation of Filters.

Browser support

First browser version supporting backdrop-filter
Chrome 76
Edge 79
Firefox 103
Safari 18
Chrome Android 76
Safari iOS 18

First version with support, from MDN browser-compat-data.

color-interpolation-filters

Property Baseline: widely availablesince January 2018

MDN The color-interpolation-filters CSS property specifies the color space for imaging operations performed via SVG filter effects. If explicitly declared, the value of the CSS property overrides any value given in the element's color-interpolation-filters attribute.

Syntax

auto | sRGB | linearRGB

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
linearRGB
Applies to
All filter primitives
Inherited
yes
Percentages
n/a
Computed value
as specified
Canonical order
per grammar
Animation type
discrete

Browser support

First browser version supporting color-interpolation-filters
Chrome 1
Edge 79
Firefox 3
Safari 3
Chrome Android 18
Safari iOS 2

First version with support, from MDN browser-compat-data.

filter

Property Baseline: widely availablesince March 2019

MDN The filter CSS property applies graphical effects like blur or color shift to an element. Filters are commonly used to adjust the rendering of images, backgrounds, and borders.

Live preview Example from MDN
.example-container {
  background-color: white;
  width: 260px;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#example-element {
  flex: 1;
  padding: 30px;
}

Syntax

none | <filter-value-list>

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
none
Applies to
All elements. In SVG, it applies to container elements without the defs element, all graphics elements and the use element.
Inherited
no
Percentages
n/a
Computed value
as specified
Canonical order
per grammar
Animation type
See prose in Animation of Filters.

Browser support

First browser version supporting filter
Chrome 53
Edge 12
Firefox 35
Safari 9.1
Chrome Android 53
Safari iOS 9.3

First version with support, from MDN browser-compat-data.

flood-color

Property Baseline: widely availablesince January 2018

MDN The flood-color CSS property defines the color of the current filter primitive subregion in feFlood and feDropShadow elements within a filter. If present, it overrides the element's flood-color attribute.

Live preview Example from MDN
rect {
  width: 100px;
  height: 100px;
  x: 10px;
  y: 10px;
}
#r2 {
  x: 150px;
}

#flood1 feFlood {
  flood-color: rebeccapurple;
}
#flood2 feFlood {
  flood-color: #ff3366;
}

Syntax

<color>

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
black
Applies to
feFlood and feDropShadow elements
Inherited
no
Percentages
n/a
Computed value
as specified
Canonical order
per grammar
Animation type
by computed value

Browser support

First browser version supporting flood-color
Chrome 5
Edge 12
Firefox 3
Safari 6
Chrome Android 18
Safari iOS 6

First version with support, from MDN browser-compat-data.

flood-opacity

Property Baseline: widely availablesince January 2018

MDN The flood-opacity CSS property defines the opacity of the current filter primitive subregion in feFlood and feDropShadow elements within a filter. If present, it overrides the element's flood-opacity attribute.

Live preview Example from MDN
svg {
  background-image: repeating-linear-gradient(
    45deg,
    transparent 0 9px,
    #cccccc 0px 10px
  );
}
rect {
  width: 100px;
  height: 100px;
  x: 10px;
  y: 10px;
}
#r2 {
  x: 150px;
}

#flood1 feFlood {
  flood-opacity: 0.5;
}
#flood2 feFlood {
  flood-opacity: 90%;
}

Syntax

<'opacity'>

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
1
Applies to
feFlood and feDropShadow elements
Inherited
no
Percentages
n/a
Computed value
the specified value converted to a number, clamped to the range [0,1]
Canonical order
per grammar
Animation type
by computed value

Browser support

First browser version supporting flood-opacity
Chrome 5
Edge 12
Firefox 3
Safari 6
Chrome Android 18
Safari iOS 6

First version with support, from MDN browser-compat-data.

lighting-color

Property Baseline: widely availablesince January 2018

MDN The lighting-color CSS property defines the color of the light source for the feDiffuseLighting and feSpecularLighting SVG lighting filter primitives within an SVG filter. If present, it overrides the element's lighting-color attribute.

Live preview Example from MDN
svg {
  background-image: repeating-linear-gradient(
    45deg,
    transparent 0 9px,
    #cccccc 0px 10px
  );
}

rect {
  width: 100px;
  height: 100px;
  x: 10px;
  y: 10px;
}

#r2 {
  x: 150px;
}

feDiffuseLighting {
  lighting-color: blue;
}

feSpecularLighting {
  lighting-color: #ff0099;
}

Syntax

<color>

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
white
Applies to
feDiffuseLighting and feSpecularLighting elements
Inherited
no
Percentages
n/a
Computed value
as specified
Canonical order
per grammar
Animation type
by computed value

Browser support

First browser version supporting lighting-color
Chrome 5
Edge 12
Firefox 3
Safari 6
Chrome Android 18
Safari iOS 6

First version with support, from MDN browser-compat-data.

blur()

Function Baseline: widely availablesince March 2019

MDN The blur() CSS function applies a Gaussian blur to the input image. It is used as a value for the filter and backdrop-filter properties.

Live preview Example from MDN
<section id="default-example">
  <img
    class="transition-all"
    id="example-element"
    src="https://developer.mozilla.org/shared-assets/images/examples/firefox-logo.svg"
    width="200" />
</section>

Syntax

/* for filter */
blur( <length>? )

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Browser support

First browser version supporting blur()
Chrome 18
Edge 12
Firefox 35
Safari 6
Chrome Android 53
Safari iOS 6

First version with support, from MDN browser-compat-data.

Defined for

filter

This feature only appears in the context of these properties, functions or types.

brightness()

Function Baseline: widely availablesince March 2019

MDN The brightness() CSS function applies a linear multiplier value on an element or an input image, making the image appear brighter or darker. It is used as a value for the filter and backdrop-filter properties.

Live preview Example from MDN
<section id="default-example">
  <img
    class="transition-all"
    id="example-element"
    src="https://developer.mozilla.org/shared-assets/images/examples/firefox-logo.svg"
    width="200" />
</section>

Syntax

/* for filter */
brightness( [ <number> | <percentage> ]? )

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Browser support

First browser version supporting brightness()
Chrome 18
Edge 12
Firefox 35
Safari 6
Chrome Android 53
Safari iOS 6

First version with support, from MDN browser-compat-data.

Defined for

filter

This feature only appears in the context of these properties, functions or types.

contrast()

Function Baseline: widely availablesince March 2019

MDN The contrast() CSS function adjusts the contrast of the input image. It is used as a value for the filter and backdrop-filter properties.

Live preview Example from MDN
<section id="default-example">
  <img
    class="transition-all"
    id="example-element"
    src="https://developer.mozilla.org/shared-assets/images/examples/firefox-logo.svg"
    width="200" />
</section>

Syntax

/* for filter */
contrast( [ <number> | <percentage> ]? )

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Browser support

First browser version supporting contrast()
Chrome 18
Edge 12
Firefox 35
Safari 6
Chrome Android 53
Safari iOS 6

First version with support, from MDN browser-compat-data.

Defined for

filter

This feature only appears in the context of these properties, functions or types.

drop-shadow()

Function Baseline: widely availablesince March 2019

MDN The drop-shadow() CSS function applies a drop shadow effect to the input image. It is used as a value for the filter and backdrop-filter properties.

Live preview Example from MDN
<section id="default-example">
  <img
    class="transition-all"
    id="example-element"
    src="https://developer.mozilla.org/shared-assets/images/examples/firefox-logo.svg"
    width="200" />
</section>

Syntax

/* for filter */
drop-shadow( [ <color>? && <length>{2,3} ] )

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Browser support

First browser version supporting drop-shadow()
Chrome 18
Edge 12
Firefox 35
Safari 6
Chrome Android 53
Safari iOS 6

First version with support, from MDN browser-compat-data.

Defined for

filter

This feature only appears in the context of these properties, functions or types.

filter()

Function Not in any browser yet

No prose in the spec's definition and no MDN page yet: the spec link below is the only description.

Syntax

filter( [ <image> | <string> ], <filter-value-list> )

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

grayscale()

Function Baseline: widely availablesince March 2019

MDN The grayscale() CSS function converts the input image to grayscale. It is used as a value for the filter and backdrop-filter properties.

Live preview Example from MDN
<section id="default-example">
  <img
    class="transition-all"
    id="example-element"
    src="https://developer.mozilla.org/shared-assets/images/examples/firefox-logo.svg"
    width="200" />
</section>

Syntax

/* for filter */
grayscale( [ <number> | <percentage> ]? )

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Browser support

First browser version supporting grayscale()
Chrome 18
Edge 12
Firefox 35
Safari 6
Chrome Android 53
Safari iOS 6

First version with support, from MDN browser-compat-data.

Defined for

filter

This feature only appears in the context of these properties, functions or types.

hue-rotate()

Function Baseline: widely availablesince March 2019

MDN The hue-rotate() CSS function rotates the hue of an element and its contents. It is used as a value for the filter and backdrop-filter properties.

Live preview Example from MDN
<section id="default-example">
  <img
    class="transition-all"
    id="example-element"
    src="https://developer.mozilla.org/shared-assets/images/examples/firefox-logo.svg"
    width="200" />
</section>

Syntax

/* for filter */
hue-rotate( [ <angle> | <zero> ]? )

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Browser support

First browser version supporting hue-rotate()
Chrome 18
Edge 12
Firefox 35
Safari 6
Chrome Android 53
Safari iOS 6

First version with support, from MDN browser-compat-data.

Defined for

filter

This feature only appears in the context of these properties, functions or types.

invert()

Function Baseline: widely availablesince March 2019

MDN The invert() CSS function inverts the color samples in the input image. It is used as a value for the filter and backdrop-filter properties.

Live preview Example from MDN
<section id="default-example">
  <img
    class="transition-all"
    id="example-element"
    src="https://developer.mozilla.org/shared-assets/images/examples/firefox-logo.svg"
    width="200" />
</section>

Syntax

/* for filter */
invert( [ <number> | <percentage> ]? )

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Browser support

First browser version supporting invert()
Chrome 18
Edge 12
Firefox 35
Safari 6
Chrome Android 53
Safari iOS 6

First version with support, from MDN browser-compat-data.

Defined for

filter

This feature only appears in the context of these properties, functions or types.

opacity()

Function Baseline: widely availablesince March 2019

MDN The opacity() CSS function applies transparency to the input image. It is used as a value for the filter and backdrop-filter properties.

Live preview Example from MDN
<section id="default-example">
  <img
    class="transition-all"
    id="example-element"
    src="https://developer.mozilla.org/shared-assets/images/examples/firefox-logo.svg"
    width="200" />
</section>

Syntax

/* for filter */
opacity( [ <number> | <percentage> ]? )

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Browser support

First browser version supporting opacity()
Chrome 18
Edge 12
Firefox 35
Safari 6
Chrome Android 53
Safari iOS 6

First version with support, from MDN browser-compat-data.

Defined for

filter

This feature only appears in the context of these properties, functions or types.

saturate()

Function Baseline: widely availablesince March 2019

MDN The saturate() CSS function super-saturates or desaturates the input image. It is used as a value for the filter and backdrop-filter properties.

Live preview Example from MDN
<section id="default-example">
  <img
    class="transition-all"
    id="example-element"
    src="https://developer.mozilla.org/shared-assets/images/examples/firefox-logo.svg"
    width="200" />
</section>

Syntax

/* for filter */
saturate( [ <number> | <percentage> ]? )

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Browser support

First browser version supporting saturate()
Chrome 18
Edge 12
Firefox 35
Safari 6
Chrome Android 53
Safari iOS 6

First version with support, from MDN browser-compat-data.

Defined for

filter

This feature only appears in the context of these properties, functions or types.

sepia()

Function Baseline: widely availablesince March 2019

MDN The sepia() CSS function converts the input image to sepia, giving it a warmer, more yellow/brown appearance. It is used as a value for the filter and backdrop-filter properties.

Live preview Example from MDN
<section id="default-example">
  <img
    class="transition-all"
    id="example-element"
    src="https://developer.mozilla.org/shared-assets/images/examples/firefox-logo.svg"
    width="200" />
</section>

Syntax

/* for filter */
sepia( [ <number> | <percentage> ]? )

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Browser support

First browser version supporting sepia()
Chrome 18
Edge 12
Firefox 35
Safari 6
Chrome Android 53
Safari iOS 6

First version with support, from MDN browser-compat-data.

Defined for

filter

This feature only appears in the context of these properties, functions or types.

<filter-function>

Type Baseline: widely availablesince March 2019

MDN The <filter-function> CSS data type represents a graphical effect that can change the appearance of an input image. It is used in the filter and backdrop-filter properties.

Live preview Example from MDN
div {
  width: 100%;
  height: 512px;
  background-image: url("https://mdn.github.io/shared-assets/images/examples/fx-nightly-512.png");
  background-repeat: no-repeat;
  background-position: center center;
}

li {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

input {
  width: 60%;
}

output {
  width: 5%;
  text-align: center;
}

select {
  width: 40%;
  margin-left: 2px;
}

Syntax

<blur()> | <brightness()> | <contrast()> | <drop-shadow()> | <grayscale()> | <hue-rotate()> | <invert()> | <opacity()> | <sepia()> | <saturate()>

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Browser support

First browser version supporting <filter-function>
Chrome 18
Edge 12
Firefox 35
Safari 6
Chrome Android 53
Safari iOS 6

First version with support, from MDN browser-compat-data.