Contents

vignette()

Gradually darkens an image’s edges.

Declaration

class func vignette() -> any CIFilter & CIVignette

Return Value

The modified image.

Discussion

This method applies the vignette filter to an image. This is a preconfigured effect that reduces brightness of the image at the periphery.

The vignette filter uses the following properties:

inputImage

An image with the type CIImage.

intensity

A float representing the intensity of the vignette effect as an NSNumber.

radius

A float representing the radius of the effect as an NSNumber.

The following code creates a filter that darkens the edges of the input image:

func vignette(inputImage: CIImage ) -> CIImage {
    let vignetteFilter = CIFilter.vignette()
    vignetteFilter.inputImage = inputImage
    vignetteFilter.intensity = 4
    vignetteFilter.radius = 10
    return vignetteFilter.outputImage!
}

[Image]

See Also

Color Effect Filters