I am working in face editing function and here I want to make face smooth as well as white skin tone.
I am able to smooth face on image using YUCIHighPassSkinSmoothing library.
But I am not able to whitening the face only can smoothing face.
self.inputCIImage = CIImage(cgImage: self.imgPhotoForEdit.image!.cgImage!)
self.filter.inputImage = self.inputCIImage
self.filter.inputRadius = 6.0
self.filter.inputAmount = NSNumber(value: selectedSmoothingValue)
self.filter.inputSharpnessFactor = 0.0
let outputCIImage = filter.outputImage!
let outputCGImage = self.context.createCGImage(outputCIImage, from: outputCIImage.extent)
let outputUIImage = UIImage(cgImage: outputCGImage!, scale: self.imgPhotoForEdit.image!.scale, orientation: self.imgPhotoForEdit.image!.imageOrientation)
self.imgPhotoForEdit.image = outputUIImage
}
Here is my code implemented using YUCIHighPassSkinSmoothing library.