Contents

screenBlendMode()

Blends colors of two images by multiplying colors.

Declaration

class func screenBlendMode() -> any CIFilter & CICompositeOperation

Return Value

The modified image.

Discussion

This method applies the screen-blend mode filter to an image. The effect calculates the colors in the output image by multiplying the inverse color values for the input and background images, resulting in a brighter image.

The screen-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 results in the image becoming lighter with colors from the input and background image:

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

[Image]

See Also

Filters