Like this .
Also consider this question - the third answer in the paranoid detail
And some code to access the pixels and save them in a new UIImage:
UIImage* image = ...;
NSData* pixelData = (NSData*) CGDataProviderCopyData(CGImageGetDataProvider(image.CGImage));
void* pixelBytes = [pixelData bytes];
for(int i = 0; i < [pixelData length]; i += 4) {
bytes[i] = 0;
bytes[i+1] = bytes[i+1];
bytes[i+2] = 0;
bytes[i+3] = 0;
}
NSData* newPixelData = [NSData dataWithBytes:pixelBytes length:[pixelData length]];
UIImage* newImage = [UIImage imageWithData:newPixelData];
adapted from here . To have three different channels in separate images, do as in the code, set everything to zero except the channel that you want to save each time, and then create a new image.