Contents

temperatureAndTint()

Alters an image’s temperature and tint.

Declaration

class func temperatureAndTint() -> any CIFilter & CITemperatureAndTint

Return Value

The modified image.

Discussion

This method applies the image temperature and tint filter to an image. The effect adjusts the white balance of the input image to match the targetNeutral property, resulting in a cooler or warmer tone image.

The temperature and tint filter uses the following properties:

neutral

A vector containing the source white point as a CIVector.

targetNeutral

A vector containing the desired white point as a CIVector.

inputImage

An image with the type CIImage.

The following code creates a filter that adds an orange hue to the input image:

func tempatureAndTint(inputImage: CIImage) -> CIImage {
    let tempatureAndTintFilter = CIFilter.temperatureAndTint()
    tempatureAndTintFilter.inputImage = inputImage
    tempatureAndTintFilter.neutral = CIVector(x: 11500, y: 10)
    tempatureAndTintFilter.targetNeutral = CIVector(x: 4000, y: 0)
    return tempatureAndTintFilter.outputImage!
}

[Image]

See Also

Filters