Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Objective-c Apply Blending mode to an image
- (UIImage *)createDimImage:(UIImage *)image; {
CGSize size = image.size;
CGRect bounds = CGRectMake(0, 0,size.width, size.height);
UIImage * dimImage;
UIGraphicsBeginImageContextWithOptions(size, NO, 0.0f);
[msColorNeutralLight setFill];
[image drawInRect:bounds blendMode:kCGBlendModeMultiply alpha:1.0f];
dimImage = UIGraphicsGetImageFromCurrentImageContext();
return dimImage;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment