---
title: "apply(foreground:background:)"
framework: coreimage
role: symbol
role_heading: Instance Method
path: "coreimage/ciblendkernel/apply(foreground:background:)"
---

# apply(foreground:background:)

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

## Declaration

```swift
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

Return Value A CIImage blending the foreground and background images.  Its extent will be the union of the foreground and background image extents.

## Discussion

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.
