Yes you can with quartz.
There is a tutorial here that shows how to take a UIImage and mask part of it.
http://iosdevelopertips.com/cocoa/how-to-mask-an-image.html
Here is the code from this page (if for some reason it doesnβt work)
- (UIImage*) maskImage:(UIImage *)image withMask:(UIImage *)maskImage { CGImageRef maskRef = maskImage.CGImage; CGImageRef mask = CGImageMaskCreate(CGImageGetWidth(maskRef), CGImageGetHeight(maskRef), CGImageGetBitsPerComponent(maskRef), CGImageGetBitsPerPixel(maskRef), CGImageGetBytesPerRow(maskRef), CGImageGetDataProvider(maskRef), NULL, false); CGImageRef masked = CGImageCreateWithMask([image CGImage], mask); return [UIImage imageWithCGImage:masked]; }
Brock woolf
source share