vibrance()
Adjusts an image’s vibrancy.
Declaration
class func vibrance() -> any CIFilter & CIVibranceReturn Value
The modified image.
Discussion
This method applies the vibrance filter to an image. The effect adjusts the saturation of the image while preserving skin tone colors.
The vibrance filter uses the following properties:
amountA
floatrepresenting the amount to adjust the saturation with the type NSNumber.inputImageAn image with the type CIImage.
The following code creates a filter that adds darkness to the input image:
func vibrance(inputImage: CIImage) -> CIImage {
let vibranceFilter = CIFilter.vibrance()
vibranceFilter.inputImage = inputImage
vibranceFilter.amount = 2
return vibranceFilter.outputImage!
}[Image]