Contents

blendWithRedMask()

Blends two images by using a red mask image.

Declaration

class func blendWithRedMask() -> any CIFilter & CIBlendWithMask

Return Value

The modified image.

Discussion

This method applies the blend with red mask filter to an image. The effect uses values from the red mask image to interpolate between the input and background images. The mask image consists of shades of red that define the strength of the interpolation from zero (where the mask image is black) to the specified radius (where the mask image is red).

The blend with red mask filter uses the following properties:

inputImage

An image with the type CIImage.

maskImage

An image that masks an area on the background image with the type CIImage.

backgroundImage

An image with the type CIImage.

The following code creates a filter that results in the replacement of green in the mask image with the detail of the input image:

func blendWithRedMask(inputimage: CIImage, backgroundimage: CIImage, maskimage: CIImage) -> CIImage {
    let  blendWithRedMaskFilter = CIFilter.blendWithRedMask()
    blendWithRedMaskFilter.inputImage = inputimage
    blendWithRedMaskFilter.maskImage = maskimage
    blendWithRedMaskFilter.backgroundImage = backgroundimage
    return blendWithRedMaskFilter.outputImage!
}

[Image]

See Also

Filters