Contents

edges()

Hilghlights edges of objects found within an image.

Declaration

class func edges() -> any CIFilter & CIEdges

Return Value

The modified image.

Discussion

This method applies the edges filter to an image. The effect uses the intensity to compute and highlight edges of items within the image.

The edges filter uses the following property:

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 results in a darker image with the edges of objects highlighted with the colors of the input image:

func edges(inputImage: CIImage) -> CIImage {
    let edgesFilter = CIFilter.edges()
    edgesFilter.inputImage = inputImage
    edgesFilter.intensity = 15
    return edgesFilter.outputImage!
}

[Image]

See Also

Filters