UIImage *srcImage = [UIImage imageNamed:@"test_image"]; UIImage *dstImage = nil; UIImage *maskImage = [UIImage imageNamed:@"mask_image"]; CGImageRef m = maskImage.CGImage; CGImageRef mask = CGImageMaskCreate(CGImageGetWidth(m), CGImageGetHeight(m), CGImageGetBitsPerComponent(m), CGImageGetBitsPerPi…