I've masked out my image thusly:
CGImageRef maskRef = [[UIImage imageNamed:@"testMask2.png"] CGImage];
CGImageRef mask = CGImageMaskCreate(CGImageGetWidth(maskRef),
CGImageGetHeight(maskRef),
CGImageGetBitsPerComponent(maskRef),
CGImageGetBitsPerPixel(maskRef),
CGImageGetBytesPerRow(maskRef),
CGImageGetDataProvider(maskRef), nil, YES);
UIImage *image = [UIImage imageWithContentsOfFile:path];
CGImageRef masked = CGImageCreateWithMask([image CGImage], mask);
imageView.image = [UIImage imageWithCGImage:masked];
And it works great, but the resulting image has BLACK where it was masked out, how can I set it to have WHITE where its masked out?