sourceOverCompositing()
Places one image over a second image.
Declaration
class func sourceOverCompositing() -> any CIFilter & CICompositeOperationMentioned in
Return Value
The modified image.
Discussion
This method applies the source-over compositing filter to an image. The effect creates the result by overlaying the input image over the background image. Unlike the other source compositing filters, source-over doesn’t subtract parts of the image.
The source-over compositing filter uses the following properties:
The following code creates a filter that results in both of the input images becoming visible with no subtraction:
func sourceOverCompositing(inputImage: CIImage, backgroundImage: CIImage) -> CIImage {
let colorBlendFilter = CIFilter.sourceOverCompositing()
colorBlendFilter.inputImage = inputImage
colorBlendFilter.backgroundImage = backgroundImage
return colorBlendFilter.outputImage!
}[Image]