vignette()
Gradually darkens an image’s edges.
Declaration
class func vignette() -> any CIFilter & CIVignetteReturn 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:
inputImageAn image with the type CIImage.
intensityA
floatrepresenting the intensity of the vignette effect as an NSNumber.radiusA
floatrepresenting 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]