morphologyMinimum()
Blurs a circular area by reducing contrasting pixels.
Declaration
class func morphologyMinimum() -> any CIFilter & CIMorphologyMinimumReturn Value
The blurred image.
Discussion
This method applies the morphology minimum filter to an image. The effect targets a circular section of the image, calculating the median color values to find colors that make up more than half the working area. Using this calculation, the effect reduces the pixels with contrasting colors to take up less of the working area. The effect is then repeated throughout the image.
The morphology minimum filter uses the following properties:
radiusA
floatrepresenting the area of effect as an NSNumber.inputImageA CIImage representing the input image to apply the filter to.
The following code creates a filter that adds a blur that adds darkness to the input image:
func morphologyMinimum(inputImage: CIImage) -> CIImage? {
let morphologyMinimumFilter = CIFilter.morphologyMinimum()
morphologyMinimumFilter.inputImage = inputImage
morphologyMinimumFilter.radius = 5
return morphologyMinimumFilter.outputImage
}[Image]