highlightShadowAdjust()
Adjusts the highlights of colors to reduce shadows.
Declaration
class func highlightShadowAdjust() -> any CIFilter & CIHighlightShadowAdjustReturn 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:
inputImageAn image with the type CIImage.
shadowAmountA
floatrepresenting the amount of generated shadow as an NSNumber.radiusA
floatrepresenting the radius of the shadow as an NSNumber.highlightAmountA
floatrepresenting 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]