---
title: "init(imageData:options:)"
framework: coreimage
role: symbol
role_heading: Initializer
path: "coreimage/cifilter-swift.class/init(imagedata:options:)"
---

# init(imageData:options:)

Creates a filter that allows the processing of RAW images.

## Declaration

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

## Parameters

- `data`: The RAW image data to initialize the object with.
- `options`: An options dictionary.

## Return Value

Return Value A CIFilter object.

## Discussion

Discussion You can pass any of the keys defined in RAW Image Options along with the appropriate value in options. You should provide a source type identifier hint key (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:) or init(imageURL:options:). These initializers create a CIFilter object with an outputImage which is a CIImage representation of the supplied RAW image. You can process After calling this method, the CIFilter object returns a 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 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 outputImage will be nil.

## See Also

### Deprecated

- [init(CVPixelBuffer:properties:options:)](coreimage/cifilter-swift.class/init(cvpixelbuffer:properties:options:)-7qpsv.md)
- [init(imageURL:options:)](coreimage/cifilter-swift.class/init(imageurl:options:).md)
- [CIRAWFilterOption](coreimage/cirawfilteroption.md)
- [serializedXMP(from:inputImageExtent:)](coreimage/cifilter-swift.class/serializedxmp(from:inputimageextent:).md)
- [filterArray(fromSerializedXMP:inputImageExtent:error:)](coreimage/cifilter-swift.class/filterarray(fromserializedxmp:inputimageextent:error:).md)
- [supportedRawCameraModels()](coreimage/cifilter-swift.class/supportedrawcameramodels().md)
