Contents

exclusionBlendMode()

Subtracts color values to blend colors with less contrast.

Declaration

class func exclusionBlendMode() -> any CIFilter & CICompositeOperation

Return Value

The modified image.

Discussion

This method applies the exclusion-blend mode filter to an image. The effect calculates the brightness value for both images and subtracts the smaller value, resulting in a darker image.

The exclusion-blend mode filter uses the following properties:

inputImage

An image with the type CIImage.

backgroundImage

An image with the type CIImage.

The following code creates a filter that mixes the colors and results in an output image that’s less saturated:

func exclusionBlendMode(inputImage: CIImage, backgroundImage: CIImage) -> CIImage {
    let colorBlendFilter = CIFilter.exclusionBlendMode()
    colorBlendFilter.inputImage = inputImage
    colorBlendFilter.backgroundImage = backgroundImage
    return colorBlendFilter.outputImage!
}

[Image]

See Also

Filters