<!--
{
  "availability" : [
    "iOS: 9.0.0 - 27.0.0",
    "iPadOS: 9.0.0 - 27.0.0",
    "macCatalyst: 13.1.0 - 27.0.0",
    "macOS: 10.11.0 - 27.0.0",
    "tvOS: 9.0.0 - 27.0.0",
    "visionOS: 1.0.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVAsynchronousCIImageFilteringRequest/finish(with:context:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVAsynchronousCIImageFilteringRequest(im)finishWithImage:context:"
  },
  "title" : "finish(with:context:)"
}
-->

# finish(with:context:)

Provides the filtered video frame image to AVFoundation for further processing or display.

```
func finish(with filteredImage: CIImage, context: CIContext?)
```

## Parameters

`filteredImage`

A Core Image image representing the output of whatever filters you’ve applied to the source image.

`context`

A Core Image context to be used for rendering the output image, or `nil` to use a default context provided by AVFoundation.

## Discussion

Call this method when your handler block has finished applying filters, passing the <doc://com.apple.documentation/documentation/CoreImage/CIFilter-swift.class/outputImage> object from the final filter in your filter chain for the `filteredImage` parameter. The pixel format for this image must be the <doc://com.apple.documentation/documentation/CoreImage/CIFormat/BGRA8> format (of the <doc://com.apple.documentation/documentation/CoreVideo/kCVPixelFormatType_32BGRA> type).

You can pass the [`sourceImage`](/documentation/AVFoundation/AVAsynchronousCIImageFilteringRequest/sourceImage) object to the `filteredImage` parameter to disable filtering for the current frame.

By default, you can pass `nil` for the `context` parameter to use a default rendering context provided by Core Image. In iOS and tvOS, the default context uses the Device RGB color space. In macOS, the default context uses the sRGB color space. AVFoundation automatically uses a GPU-accelerated context if possible. To use a different color space or control other rendering options, pass your own <doc://com.apple.documentation/documentation/CoreImage/CIContext> object instead.

> Important:
> A <doc://com.apple.documentation/documentation/CoreImage/CIContext> instance is a heavyweight object that maintains expensive rendering state. Don’t create a new context object in the block where you call this method (which runs once per video frame); instead, create a <doc://com.apple.documentation/documentation/CoreImage/CIContext> instance before create a composition with the ``doc://com.apple.avfoundation/documentation/AVFoundation/AVVideoComposition/init(asset:applyingCIFiltersWithHandler:)`` method, and use that instance in your handler block.

---

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)