Contents

areaMinimum()

Calculates the minimum color component values for a specified area of the image.

Declaration

class func areaMinimum() -> any CIFilter & CIAreaMinimum

Return Value

A 1 x 1 size image containing the minimum color component values.

Discussion

This filter returns the minimum color components in the region defined by extent.

The area minimum filter uses the following properties:

inputImage

An image with the type CIImage.

extent

A CGRect that specifies the subregion of the image that you want to process.

The following code creates a filter that calculates the minimum color components of a 500 x 500 set of pixels from the center of the image:

func areaMinimum(inputImage: CIImage) -> CIImage {
    let filter = CIFilter.areaMinimum()
    filter.inputImage = inputImage
    filter.extent = CGRect(
        x: inputImage.extent.width/2-250,
        y: inputImage.extent.height/2-250,
        width: 500,
        height: 500)
    return filter.outputImage!
}

[Image]

See Also

Filters