hexagonalPixellate()
Creates an image made of a series of colorful hexagons.
Declaration
class func hexagonalPixellate() -> any CIFilter & CIHexagonalPixellateReturn Value
The modified image.
Discussion
This method applies the hexagonal pixelate filter to an image. The effect creates an image containing colored hexagons.
The hexagonal pixelate filter uses the following properties:
inputImageAn image with the type CIImage.
centerA set of coordinates marking the center of the image as a CGPoint.
scaleA
floatrepresenting the scale of the hexagons as an NSNumber.
The following code creates a filter that results in an image made up of hexagons:
func hexagonalPixelate (inputImage: CIImage) -> CIImage {
let hexagonalPixelateFilter = CIFilter.hexagonalPixellate()
hexagonalPixelateFilter.inputImage = inputImage
hexagonalPixelateFilter.center = CGPoint(x: 2016, y: 1512)
hexagonalPixelateFilter.scale = 50
return hexagonalPixelateFilter.outputImage!
}[Image]