# `<filter>`

[Canonical page](https://nothing.graphics/docs/format/reference/filter) · [Page source on GitHub](https://github.com/gridaco/nothing/blob/main/ncf/docs/reference/filter.md)

Process an assembled drawable through ordered image operations.

## Examples

[Download the complete .nothing source](https://nothing.graphics/format/source-and-backdrop/source.nothing) · [Source on GitHub](https://github.com/gridaco/nothing/blob/main/ncf/conformance/backdrop/panel.nothing)

Rendered with ncf-preview at 64 × 32.

- [Frame 0 · Frosted panel](https://nothing.graphics/format/source-and-backdrop/0.webp). A sharp white stripe diffuses under the tinted panel. A thin red shadow extends to the panel’s right, and a yellow stripe paints sharply above the result.

```xml
<scene width="64" height="32" frame-rate="24" background="#000000FF">
  <shape>
    <rect anchor-u="0" anchor-v="0" offset-x="20" width="4" height="32"/>
    <fill><paint><solid color="#FFFFFFFF"/></paint></fill>
  </shape>
  <shape>
    <rect anchor-u="0" anchor-v="0" offset-x="10" offset-y="6" width="40" height="18" corner-radius="3"/>
    <backdrop-filter><blur sigma="3"/></backdrop-filter>
    <fill><paint><solid color="#3080C030"/></paint></fill>
    <filter><drop-shadow dx="4" dy="2" sigma="0" color="#FF0000FF"/></filter>
  </shape>
  <shape>
    <rect anchor-u="0" anchor-v="0" offset-x="28" width="2" height="32"/>
    <fill><paint><solid color="#FFFF00FF"/></paint></fill>
  </shape>
</scene>
```



<!-- Generated by ncf/tools/reference/generate.mjs. -->

A source filter processes the owner's assembled local picture, before its mask and opacity. A nonempty filter isolates its input even at a sample that has an identity blur.

## Syntax [#syntax]

### Shade the source, then cast its shadow [#shade-the-source-then-cast-its-shadow]

The inner shadow tints the linked image while preserving alpha. The drop shadow then uses that alpha. The cast stays at alpha 128 at (160, 71) throughout the inner-offset animation.

```xml
<filter>
  <inner-shadow dx="0" dy="0" sigma="0" color="#FF0000FF">
    <animate attributeName="dx" fill="freeze">
      <key frame="0" value="0" ease="linear"/>
      <key frame="24" value="12"/>
    </animate>
  </inner-shadow>
  <drop-shadow dx="0" dy="44" sigma="0" color="#F9AB52FF"/>
</filter>
```

[Complete .nothing source](https://github.com/gridaco/nothing/blob/main/ncf/examples/inner-shadows.nothing) · [Sample checks](https://github.com/gridaco/nothing/blob/main/ncf/conformance/README.md#layer-effects)

## Usage context [#usage-context]

Allowed parents are [`<shape>`](https://nothing.graphics/docs/format/reference/shape), [`<group>`](https://nothing.graphics/docs/format/reference/group), [`<sequence>`](https://nothing.graphics/docs/format/reference/sequence).

## Children [#children]

| Elements                                                                                                                                                                                                                        | Cardinality  | Declared by | Role and source order                                                                                                                                                                                                             |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`<blur>`](https://nothing.graphics/docs/format/reference/blur), [`<drop-shadow>`](https://nothing.graphics/docs/format/reference/drop-shadow), [`<inner-shadow>`](https://nothing.graphics/docs/format/reference/inner-shadow) | Zero or more | `<filter>`  | Operations may repeat. An empty list returns its input. Document order. Each operation receives the preceding operation's entire result. [Source filter operations](https://nothing.graphics/docs/format/spec/filters#operations) |

## Specifications [#specifications]

* [Filters and shadows](https://nothing.graphics/docs/format/spec/filters)
* [Source filter operations](https://nothing.graphics/docs/format/spec/filters#operations)
