<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.13.0 -",
    "tvOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreImage",
  "identifier" : "/documentation/CoreImage/CIContext/startTask(toClear:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Image",
      "CoreImage"
    ],
    "preciseIdentifier" : "c:objc(cs)CIContext(im)startTaskToClear:error:"
  },
  "title" : "startTask(toClear:)"
}
-->

# startTask(toClear:)

Fills the entire destination with black or clear depending on its [`alphaMode`](/documentation/CoreImage/CIRenderDestination/alphaMode).

```
func startTask(toClear destination: CIRenderDestination) throws -> CIRenderTask
```

## Parameters

`destination`

The [`CIRenderDestination`](/documentation/CoreImage/CIRenderDestination) to clear.

## Return Value

The asynchronous [`CIRenderTask`](/documentation/CoreImage/CIRenderTask) for clearing the destination.

## Discussion

If the destination’s [`alphaMode`](/documentation/CoreImage/CIRenderDestination/alphaMode) is [`CIRenderDestinationAlphaMode.none`](/documentation/CoreImage/CIRenderDestinationAlphaMode/none), this command fills the entire destination with black `(0, 0, 0, 1)`.

If the destination’s [`alphaMode`](/documentation/CoreImage/CIRenderDestination/alphaMode) is [`CIRenderDestinationAlphaMode.premultiplied`](/documentation/CoreImage/CIRenderDestinationAlphaMode/premultiplied) or [`CIRenderDestinationAlphaMode.unpremultiplied`](/documentation/CoreImage/CIRenderDestinationAlphaMode/unpremultiplied), this command fills the entire destination with clear `(0, 0, 0, 0)`.

---

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)