I am trying to create a CIFilter with an overlay mode (like overlay or multiplication). Relevant Code:
NSData *imageData = UIImageJPEGRepresentation(image, 0.85);
CIImage *beginImage = [CIImage imageWithData:imageData];
CIImage *overlay = [CIImage imageWithColor:[CIColor colorWithRed:0.7 green:0.75 blue:0.9 alpha:0.75]];
CIContext *context = [CIContext contextWithOptions:nil];
CIFilter *filter = [CIFilter filterWithName:@"CIOverlayBlendMode"
keysAndValues:@"inputImage", beginImage,
@"inputBackgroundImage", overlay,
nil];
Other filters work fine (for example, a sepia tone), but with a filter that requires the "inputBackgroundImage" key, I get an empty / empty result ... so something seems wrong with my background image.
How to use the blend mode filter by placing a solid color over the image?
source
share