首页 > 代码库 > iOS 图像处理-调整图像亮度
iOS 图像处理-调整图像亮度
- (UIImage*) getBrighterImage:(UIImage *)originalImage { UIImage *brighterImage; CIContext *context = [CIContext contextWithOptions:nil]; CIImage *inputImage = [CIImage imageWithCGImage:originalImage.CGImage]; CIFilter *lighten = [CIFilter filterWithName:@"CIColorControls"]; [lighten setValue:inputImage forKey:kCIInputImageKey]; [lighten setValue:@(0.3) forKey:@"inputBrightness"]; CIImage *result = [lighten valueForKey:kCIOutputImageKey]; CGImageRef cgImage = [context createCGImage:result fromRect:[inputImage extent]]; brighterImage = [UIImage imageWithCGImage:cgImage]; CGImageRelease(cgImage); return brighterImage; }
參考链接:
http://www.raywenderlich.com/22167/beginning-core-image-in-ios-6
http://blog.csdn.net/willyang519/article/details/38716019
iOS 图像处理-调整图像亮度
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。