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

# init(imageData:options:)

Creates a filter that allows the processing of RAW images.

```
init!(imageData data: Data!, options: [CIRAWFilterOption : Any]! = [:])
```

## Parameters

`data`

The RAW image data to initialize the object with.

`options`

An options dictionary.

## Return Value

A [`CIFilter`](/documentation/CoreImage/CIFilter-swift.class) object.

## Discussion

You can pass any of the keys defined in [RAW Image Options](/documentation/CoreImage/raw-image-options) along with the appropriate value in `options`. You should provide a source type identifier hint key (<doc://com.apple.documentation/documentation/ImageIO/kCGImageSourceTypeIdentifierHint>) and the appropriate source type value to help the decoder determine the file type. Otherwise it’s possible to obtain incorrect results.

The first step when working with RAW images in Core Image is to process the image using either [`init(imageData:options:)`](/documentation/CoreImage/CIFilter-swift.class/init(imageData:options:)) or [`init(imageURL:options:)`](/documentation/CoreImage/CIFilter-swift.class/init(imageURL:options:)). These initializers create a [`CIFilter`](/documentation/CoreImage/CIFilter-swift.class) object with an [`outputImage`](/documentation/CoreImage/CIFilter-swift.class/outputImage) which is a [`CIImage`](/documentation/CoreImage/CIImage) representation of the supplied RAW image. You can process After calling this method, the [`CIFilter`](/documentation/CoreImage/CIFilter-swift.class) object returns a [`CIImage`](/documentation/CoreImage/CIImage) object that’s properly processed similar to images retrieved using the `outputImage` key.

> Important:
> Core Image doesn’t process the supplied RAW image until the filter’s ``doc://com.apple.coreimage/documentation/CoreImage/CIFilter-swift.class/outputImage`` is rendered. For this reason, if you supply this initializer with a RAW image of an unsupported format, the filter object will be initialized but its ``doc://com.apple.coreimage/documentation/CoreImage/CIFilter-swift.class/outputImage`` will be `nil`.

---

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)