<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreImage",
  "identifier" : "/documentation/CoreImage/CIImageProcessorKernel/apply(withExtent:inputs:arguments:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Core Image"
    ],
    "preciseIdentifier" : "c:objc(cs)CIImageProcessorKernel(cm)applyWithExtent:inputs:arguments:error:"
  },
  "title" : "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.

```
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 [`CIImage`](/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`,
[`CIVector`](/documentation/CoreImage/CIVector), [`CIColor`](/documentation/CoreImage/CIColor), `CGImage`, `CGColorSpace`, or `MLModel`.

## Return Value


An autoreleased [`CIImage`](/documentation/CoreImage/CIImage)

## 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`](/documentation/CoreImage/CIImageProcessorKernel/outputFormat) on your subclass returns an unsupported format.
- calling [`formatForInput(at:)`](/documentation/CoreImage/CIImageProcessorKernel/formatForInput(at:)) on your subclass returns an unsupported format.
- your subclass does not implement [`process(with:arguments:output:)`](/documentation/CoreImage/CIImageProcessorKernel/process(with:arguments:output:))

---

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)