crystallize()
Creates an image made with a series of colorful polygons.
Declaration
class func crystallize() -> any CIFilter & CICrystallizeReturn Value
The modified image.
Discussion
This method applies the crystallize filter to an image. The effect creates polygon-shaped color blocks by aggregating pixel-color values.
The crystallize filter uses the following properties:
inputImageAn image with the type CIImage.
radiusA
floatrepresenting the area of effect as an NSNumber.centerA set of coordinates marking the center of the image as a CGPoint.
The following code creates a filter that results in an image made of small polygons:
func crystalize(inputImage: CIImage) -> CIImage {
let crystalizefilter = CIFilter.crystallize()
crystalizefilter.inputImage = inputImage
crystalizefilter.radius = 50
crystalizefilter.center = CGPoint(x: 2016, y: 1512)
return crystalizefilter.outputImage!
}[Image]