- (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

相关文章:

  • 2022-01-27
  • 2021-10-16
  • 2022-12-23
  • 2021-08-05
  • 2022-12-23
  • 2021-12-26
  • 2021-09-24
  • 2021-12-16
猜你喜欢
  • 2021-07-19
  • 2021-05-25
  • 2021-12-02
  • 2021-11-19
  • 2022-01-19
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案