Contents

vibrance()

Adjusts an image’s vibrancy.

Declaration

class func vibrance() -> any CIFilter & CIVibrance

Return 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:

amount

A float representing the amount to adjust the saturation with the type NSNumber.

inputImage

An 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]

See Also

Filters