sharpenLuminance()
Applies a sharpening effect to an image.
Declaration
class func sharpenLuminance() -> any CIFilter & CISharpenLuminanceReturn Value
The modified image.
Discussion
This method applies the sharpen luminance filter to an image. The effect increases image detail by adjusting the luminance of each pixel within the radius property. Sharpening the luminance doesn’t effect the chroma data of each pixel.
The bicubic sharpen luminance filter uses the following properties:
inputImageAn image with the type CIImage.
radiusA
floatrepresenting the area of effect as an NSNumber.sharpnessA
floatrepresenting the desired strength of the effect as an NSNumber.
The following code creates a filter that results in detail from the sign in the image to be more visible:
func sharpen (inputImage: CIImage) -> CIImage? {
let sharpenLuminance = CIFilter.sharpenLuminance()
sharpenLuminance.inputImage = inputImage
sharpenLuminance.radius = 10
sharpenLuminance.sharpness = 1
return sharpenLuminance.outputImage!
}[Image]