直接将图片转换为模糊.
// 高斯毛玻璃-Swift
func convertImageToBlur(_ originImage: UIImage) -> UIImage? {
let context = CIContext.init(options: nil)
let inputImage = CIImage.init(image: originImage)
let filter = CIFilter.init(name: "CIGaussianBlur")
filter?.setValue(inputImage, forKey: kCIInputImageKey)
filter?.setValue(15, forKeyPath: "inputRadius")
// --> CIImage
let outputImage = filter?.value(forKey: kCIOutputImageKey) as! CIImage
// --> CGImage
let resultImage: CGImage? = context.createCGImage(outputImage, from: inputImage!.extent)
// --> UIImage
let newImage = UIImage.init(cgImage: resultImage!)
return newImage
}