blendWithBlueMask()
Blends two images by using a blue mask image.
Declaration
class func blendWithBlueMask() -> any CIFilter & CIBlendWithMaskReturn Value
The modified image.
Discussion
This method applies the blend with blue mask filter to an image. The effect uses values from the blue mask image to interpolate between the input and background images. The mask image is made of shades of blue that define the strength of the interpolation from zero (where the mask image is black) to the specified radius (where the mask image is blue).
The blend with blue mask filter uses the following properties:
inputImageAn image with the type CIImage.
maskImageAn image that masks an area on the background image with the type CIImage.
backgroundImageAn image with the type CIImage.
The following code creates a filter that results in the replacement of blue in the mask image with the detail of the input image:
func blendWithBlueMask(inputimage: CIImage, backgroundimage: CIImage, maskimage: CIImage) -> CIImage {
let blendWithBlueMaskFilter = CIFilter.blendWithBlueMask()
blendWithBlueMaskFilter.inputImage = inputimage
blendWithBlueMaskFilter.maskImage = maskimage
blendWithBlueMaskFilter.backgroundImage = backgroundimage
return blendWithBlueMaskFilter.outputImage!
}[Image]