saturationBlendMode()
Blends the colors and saturation values of two images.
Declaration
class func saturationBlendMode() -> any CIFilter & CICompositeOperationReturn Value
The modified image.
Discussion
This method applies the saturation-blend mode filter to an image. The effect uses the values of the hue and luminance from the background image with the saturation of the input image to produce the output.
The saturation-blend mode filter uses the following properties:
The following code creates a filter that results in the image taking on the colors of the background image with low saturated values becoming gray.
func saturationBlendMode(inputImage: CIImage, backgroundImage: CIImage) -> CIImage {
let colorBlendFilter = CIFilter.saturationBlendMode()
colorBlendFilter.inputImage = inputImage
colorBlendFilter.backgroundImage = backgroundImage
return colorBlendFilter.outputImage!
}[Image]