Contents

dither()

Applies randomized noise to produce a processed look.

Declaration

class func dither() -> any CIFilter & CIDither

Return Value

The modified image.

Discussion

The effect applies a dithering effect to the input image. The effect applies randomized noise to the input image to produce a processed look.

The dither filter uses the following properties:

inputImage

An image with the type CIImage.

intensity

A float representing the desired strength of the effect as an NSNumber.

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

func dither(inputImage: CIImage) -> CIImage {
    let ditherFilter = CIFilter.dither()
    ditherFilter.inputImage = inputImage
    ditherFilter.intensity = 0.4
    return ditherFilter.outputImage!
}

[Image]

See Also

Color Effect Filters