Contents

bloom()

Adjusts an image’s colors by applying a blur effect.

Declaration

class func bloom() -> any CIFilter & CIBloom

Return Value

The modified image.

Discussion

This method applies the bloom filter to an image. The effect softens edges and adds a slight blur effect.

The bloom filter uses the following properties:

inputImage

An image with the type CIImage.

radius

A float representing the area of effect as an NSNumber.

intensity

A float representing the desired strength of the effect as an NSNumber.

The following code creates a filter that results in a hazy effect on the image:

func bloom(inputImage: CIImage) -> CIImage {
    let bloomFilter = CIFilter.bloom()
    bloomFilter.inputImage = inputImage
    bloomFilter.radius = 10
    bloomFilter.intensity = 1
    return bloomFilter.outputImage!
}

[Image]

See Also

Filters