iOS 图像处理-调整图像亮度
Posted clnchanpin
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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
以上是关于iOS 图像处理-调整图像亮度的主要内容,如果未能解决你的问题,请参考以下文章