<!--
{
  "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/CIBlendKernel/apply(foreground:background:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Image"
    ],
    "preciseIdentifier" : "c:objc(cs)CIBlendKernel(im)applyWithForeground:background:"
  },
  "title" : "apply(foreground:background:)"
}
-->

# apply(foreground:background:)

Creates a new image using the blend kernel and specified foreground and background images.

```
func apply(foreground: CIImage, background: CIImage) -> CIImage?
```

## Parameters

`foreground`

The first input image to be blended

`background`

The second input image to be blended

## Return Value

A [`CIImage`](/documentation/CoreImage/CIImage) blending the foreground and background images.  Its extent will be the union of the foreground and background image extents.

## Discussion

The foreground and background images are not treated differently in the blending.  You can think of them as equivalents A and B; the foreground is not given any precedence over the background.

---

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)