Contents

photoEffectTonal()

Adjusts an image’s colors to black and white.

Declaration

class func photoEffectTonal() -> any CIFilter & CIPhotoEffect

Return Value

The modified image.

Discussion

This method applies a preconfigured set of effects that imitate black-and-white photography film without significantly altering contrast.

The photo effect tonal filter uses the following property:

inputImage

An image with the type CIImage.

The following code creates a filter that produces a grayscale image:

func photoEffectTonal(inputImage: CIImage ) -> CIImage {
    let photoEffect = CIFilter.photoEffectTonal()
    photoEffect.inputImage = inputImage
    return photoEffect.outputImage!
}

[Image]

See Also

Color Effect Filters