Retrieving a pixel alpha value for a UIImage
If all you want is the alpha value of a single point, all you need is an alpha-only single-point buffer. I believe this should suffice: // assume im is a UIImage, point is the CGPoint to test CGImageRef cgim = im.CGImage; unsigned char pixel[1] = {0}; CGContextRef context = CGBitmapContextCreate(pixel, 1, 1, 8, 1, NULL, … Read more