---
title: CIFilterGenerator
framework: Core Image
role: symbol
role_heading: Class
platforms: [macOS 10.5+]
path: coreimage/cifiltergenerator
---

# CIFilterGenerator

An object that creates and configures chains of individual image filters.

## Declaration

```swift
class CIFilterGenerator
```

## Overview

Overview The CIFilterGenerator class provides methods for creating a CIFilter object by chaining together existing CIFilter objects to create complex effects. (A filter chain refers to the CIFilter objects that are connected in the CIFilterGenerator object.) The complex effect can be encapsulated as a CIFilterGenerator object and saved as a file so that it can be used again. The filter generator file contains an archived instance  of all the CIFilter objects that are chained together. Any filter generator files that you copy to /Library/Graphics/Image Units/ are loaded when any of the loading methods provided by the CIPlugIn class are invoked. A CIFilterGenerator object is registered by its filename or, if present, by a class attribute that you supply in its description. You can create a  CIFilterGenerator object  programmatically, using the methods provided by the CIFilterGenerator class, or by using the editor view provided by Core Image.

## Topics

### Initializing a Filter Generator Object

- [init(contentsOf:)](coreimage/cifiltergenerator/init(contentsof:).md)

### Connecting and Disconnecting Objects

- [connect(_:withKey:to:withKey:)](coreimage/cifiltergenerator/connect(_:withkey:to:withkey:).md)
- [disconnectObject(_:withKey:to:withKey:)](coreimage/cifiltergenerator/disconnectobject(_:withkey:to:withkey:).md)

### Managing Exported Keys

- [exportedKeys](coreimage/cifiltergenerator/exportedkeys.md)
- [exportKey(_:from:withName:)](coreimage/cifiltergenerator/exportkey(_:from:withname:).md)
- [removeExportedKey(_:)](coreimage/cifiltergenerator/removeexportedkey(_:).md)
- [setAttributes(_:forExportedKey:)](coreimage/cifiltergenerator/setattributes(_:forexportedkey:).md)

### Setting and Getting Class Attributes

- [classAttributes](coreimage/cifiltergenerator/classattributes.md)

### Archiving a Filter Generator Object

- [write(to:atomically:)](coreimage/cifiltergenerator/write(to:atomically:).md)

### Registering a Filter Chain

- [registerFilterName(_:)](coreimage/cifiltergenerator/registerfiltername(_:).md)

### Creating a Filter from a Filter Chain

- [filter()](coreimage/cifiltergenerator/filter().md)

### Constants

- [Exported Keys](coreimage/exported-keys.md)

### Initializers

- [init(coder:)](coreimage/cifiltergenerator/init(coder:).md)
- [init(contentsOfURL:)](coreimage/cifiltergenerator/init(contentsofurl:)-4nqjf.md)
- [init(contentsOfURL:)](coreimage/cifiltergenerator/init(contentsofurl:)-8q8ic.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CIFilterConstructor](coreimage/cifilterconstructor.md)
- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)

## See Also

### Image Units

- [CIPlugIn](coreimage/ciplugin.md)
- [CIPlugInRegistration](coreimage/cipluginregistration.md)
- [CIFilterConstructor](coreimage/cifilterconstructor.md)
