NSData* pixelData = (NSData*)
CGDataProviderCopyData(CGImageGetDataProvider(c.CGImage));
unsigned char* pixelBytes = (unsigned char *)[pixelData bytes];
for(int i = 0; i < [pixelData length]; i += 4) {
NSLog(@"pixelBytes[i] R:%i G:%i B:%i A:%i ",
(int)pixelBytes[i],
(int)pixelBytes[i+1],
(int)pixelBytes[i+2],
(int)pixelBytes[i+3]);
/*
pixelBytes[i] = pixelBytes[i+3];
pixelBytes[i+1] = pixelBytes[i+3];
pixelBytes[i+2] = pixelBytes[i+3];
pixelBytes[i+3] = 0;
*/
}
NSData* newPixelData = [NSData dataWithBytes:pixelBytes length:[pixelData length]];
UIImage* newImage = [UIImage imageWithData:newPixelData];