Contents

discBlur()

Applies a circle-shaped blur to an area of an image.

Declaration

class func discBlur() -> any CIFilter & CIDiscBlur

Return Value

The blurred image.

Discussion

This method applies the disc blur filter to an image. The effect targets the pixels within a circle defined by a radius and calculates the median color value to create to the output image.

The disc blur filter uses the following properties:

radius

A float representing the area of effect as an NSNumber.

inputImage

A CIImage representing the input image to apply the filter to.

The following code creates a filter that adds a strong blur to the input image:

    func discBlur(inputImage: CIImage) -> CIImage? {

        let discBlurFilter = CIFilter.discBlur()
        discBlurFilter.inputImage = inputImage
        discBlurFilter.radius = 8
        return discBlurFilter.outputImage
    }

[Image]

See Also

Filters