---
title: "apply(withExtent:inputs:arguments:)"
framework: coreimage
role: symbol
role_heading: Type Method
path: "coreimage/ciimageprocessorkernel/apply(withextent:inputs:arguments:)"
---

# apply(withExtent:inputs:arguments:)

Call this method on your Core Image Processor Kernel subclass to create a new image of the specified extent.

## Declaration

```swift
class func apply(withExtent extent: CGRect, inputs: [CIImage]?, arguments: [String : Any]?) throws -> CIImage
```

## Parameters

- `extent`: The bounding CGRect of pixels that the CIImageProcessorKernel can produce. This method will return /CIImage/emptyImage if extent is empty.
- `inputs`: An array of doc://com.apple.coreimage/documentation/CoreImage/CIImage objects to use as input.
- `arguments`: This dictionary contains any additional parameters that the processor needs to produce its output. The argument objects can be of any type but in order for CoreImage to cache intermediates, they must be of the following immutable types: NSArray, NSDictionary, NSNumber, NSValue, NSData, NSString, NSNull, doc://com.apple.coreimage/documentation/CoreImage/CIVector, doc://com.apple.coreimage/documentation/CoreImage/CIColor, CGImage, CGColorSpace, or MLModel.

## Return Value

Return Value  An autoreleased CIImage

## Discussion

Discussion The inputs and arguments will be retained so that your subclass can be called when the image is drawn. This method will return nil and an error if: calling outputFormat on your subclass returns an unsupported format. calling formatForInput(at:) on your subclass returns an unsupported format. your subclass does not implement process(with:arguments:output:)

## See Also

### Type Methods

- [formatForInput(at:)](coreimage/ciimageprocessorkernel/formatforinput(at:).md)
- [process(with:arguments:output:)](coreimage/ciimageprocessorkernel/process(with:arguments:output:).md)
- [roi(forInput:arguments:outputRect:)](coreimage/ciimageprocessorkernel/roi(forinput:arguments:outputrect:).md)
- [roiTileArray(forInput:arguments:outputRect:)](coreimage/ciimageprocessorkernel/roitilearray(forinput:arguments:outputrect:).md)
