#pragma mark - 高斯模糊 image圖片 blur模糊度
```
- (UIImage *)blurryImage:(UIImage *)image withBlurLevel:(CGFloat)blur
{
___start_log___
CIImage *inputImage = [CIImage imageWithCGImage:image.CGImage];
CIFilter *filter = [CIFilter filterWithName:@"CIGaussianBlur"
keysAndValues:kCIInputImageKey, inputImage,
@"inputRadius", @(blur), nil];
CIImage *outputImage = filter.outputImage;
CIContext *context = [CIContext contextWithOptions:nil];
CGImageRef outImage = [context createCGImage:outputImage fromRect:[inputImage extent]];
return [UIImage imageWithCGImage:outImage];
}
```
復(fù)制 ?直接使用!
建議在線(xiàn)程中使用!