I want to remove a BLACK shadow border around Image when applying a Blur filter.
Please review below-attached screenshot. Blur function work correctly but want to remove a black shadow. I only want to do blur an Image. I don't want to apply any color effect with blur. Please let us know when should I missed...
Here I Have uploaded Image due to the low points:
https://drive.google.com/open?id=1KtVgqRXOmIEQXh9IMyWNAlariL0hcJBN https://drive.google.com/open?id=1l2eLq7VwFPb3-SfIokW0Ijhk2jqUvjlU
Here is my function to Apply Blur effects on particular Image:
Parameter :
doBlurImage - Main Image want to Blur it
imageBlurValue - Blur value from 0 to 50 Float
func makeBlurImage(doBlurImage : UIImage, imageBlurValue : CGFloat) -> UIImage {
let beginImage = CIImage(image: doBlurImage)
let currentFilter = CIFilter(name: "CIGaussianBlur")
currentFilter!.setValue(beginImage, forKey: kCIInputImageKey)
currentFilter!.setValue(imageBlurValue, forKey: kCIInputRadiusKey)
let cropFilter = CIFilter(name: "CICrop")
cropFilter!.setValue(currentFilter!.outputImage, forKey: kCIInputImageKey)
cropFilter!.setValue(CIVector(cgRect: beginImage!.extent), forKey: "inputRectangle")
let output = cropFilter!.outputImage
return UIImage(ciImage: output!)
}
These are possible options to generate a Blur effect in ios:
Blur effect using GPUImage:
var resultImage = UIImage()
let gaussianBlur = GaussianBlur()
gaussianBlur.blurRadiusInPixels = Float(ImageBlurValue)
let pictureInput = PictureInput(image: YourImage)
let pictureOutput = PictureOutput()
pictureOutput.imageAvailableCallback = {image in
print("Process completed")
resultImage = image
}
pictureInput --> gaussianBlur --> pictureOutput
pictureInput.processImage(synchronously:true)
pictureInput.removeAllTargets()
return resultImage
Happy Coding!...:)