Contents

noiseReduction()

Reduces noise by sharpening the edges of objects.

Declaration

class func noiseReduction() -> any CIFilter & CINoiseReduction

Return Value

The blurred image.

Discussion

This method applies the noise reduction filter to an image. The effect calculates changes in luminance below the noise level and locally blurs the area. Values above the threshold are determined to be edges, and become sharpened.

The morphology noise reduction filter uses the following properties:

noiseLevel

A float representing the amount of noise reduction as an NSNumber.

sharpness

A float representing the sharpness of the final image as an NSNumber.

inputImage

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

The following code creates a filter that reduces noise in the input image:

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

        let noiseReductionfilter = CIFilter.noiseReduction()
        noiseReductionfilter.inputImage = inputImage
        noiseReductionfilter.noiseLevel = 0.2
        noiseReductionfilter.sharpness = 0.4
        return noiseReductionfilter.outputImage
    }

[Image]

See Also

Filters