Contents

highlightShadowAdjust()

Adjusts the highlights of colors to reduce shadows.

Declaration

class func highlightShadowAdjust() -> any CIFilter & CIHighlightShadowAdjust

Return Value

The modified image.

Discussion

This method applies the highlight-shadow adjust filter to an image. The effect adjusts shadows, while preserving spatial detail in the image.

The highlight-shadow adjust filter uses the following properties:

inputImage

An image with the type CIImage.

shadowAmount

A float representing the amount of generated shadow as an NSNumber.

radius

A float representing the radius of the shadow as an NSNumber.

highlightAmount

A float representing the strength of the shadow as an NSNumber.

The following code creates a filter that results in a brighter image with reduced shadows:

func highlightShadowAdjust(inputImage: CIImage) -> CIImage {
    let highlightShadowAdjustFilter = CIFilter.highlightShadowAdjust()
    highlightShadowAdjustFilter.inputImage = inputImage
    highlightShadowAdjustFilter.shadowAmount = 1
    return highlightShadowAdjustFilter.outputImage!
}

[Image]

See Also

Filters