Contents

pointillize()

Applies a pointillize effect to an image.

Declaration

class func pointillize() -> any CIFilter & CIPointillize

Return Value

A CIImage containing the pointillized image.

Discussion

This filter applies a pointillize effect to an image. The effect generates an output image made of small, single-color, circular points distributed on a randomly perturbed grid.

The pointillize filter uses the following properties:

inputImage

A CIImage containing the input image.

radius

The radius in pixels of the circular points.

center

Determines the origin of the grid.

The following code applies the pointillize filter with a radius of 40 pixels.

func pointillize(inputImage: CIImage) -> CIImage {
    let pointillizeFilter = CIFilter.pointillize()
    pointillizeFilter.inputImage = inputImage
    pointillizeFilter.radius = 40
    pointillizeFilter.center = CGPoint(x: 0,y: 0)
    return pointillizeFilter.outputImage!
}

[Image]

See Also

Filters