<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreImage",
  "identifier" : "/documentation/CoreImage/CIFilter-swift.class/init(name:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Core Image",
      "CoreImage"
    ],
    "preciseIdentifier" : "c:objc(cs)CIFilter(cm)filterWithName:"
  },
  "title" : "init(name:)"
}
-->

# init(name:)

Creates a [`CIFilter`](/documentation/CoreImage/CIFilter-swift.class) object for a specific kind of filter.

```
init?(name: String)
```

## Parameters

`name`

The name of the filter. You must make sure the name is spelled correctly, otherwise your app will run but not produce any output images. For that reason, you should check for the existence of the filter after calling this method.

## Return Value

A [`CIFilter`](/documentation/CoreImage/CIFilter-swift.class) object whose input values are undefined.

## Discussion

In macOS, after creating a filter with this method you must call [`setDefaults()`](/documentation/CoreImage/CIFilter-swift.class/setDefaults()) or set parameters individually by calling <doc://com.apple.documentation/documentation/ObjectiveC/NSObject-swift.class/setValue(_:forKey:)>. In iOS, the filter’s parameters are automatically set to default values.

## See Also

  [Image Unit Tutorial](https://developer.apple.com/library/archive/documentation/GraphicsImaging/Conceptual/ImageUnitTutorial/Introduction/Introduction.html#//apple_ref/doc/uid/TP40004531)

[`+  filterWithName:keysAndValues:`](/documentation/CoreImage/CIFilter-swift.class/filterWithName:keysAndValues:)

Creates a [`CIFilter`](/documentation/CoreImage/CIFilter-swift.class) object for a specific kind of filter and initializes the input values with a `nil`-terminated list of arguments.

  [Core Image Filter Reference](https://developer.apple.com/library/archive/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/uid/TP40004346)

  [Core Image Programming Guide](https://developer.apple.com/library/archive/documentation/GraphicsImaging/Conceptual/CoreImaging/ci_intro/ci_intro.html#//apple_ref/doc/uid/TP30001185)



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)