---
title: filter()
framework: Core Image
role: symbol
role_heading: Instance Method
platforms: [macOS 10.5+]
path: coreimage/cifiltergenerator/filter()
---

# filter()

Creates a filter object based on the filter chain.

## Declaration

```swift
func filter() -> CIFilter
```

## Return Value

Return Value A CIFilter object.

## Discussion

Discussion The topology of the filter chain is immutable, meaning that any changes you make to the filter chain are not reflected in the filter. The returned filter holds the export input and output keys.
