When I use UIImagePNGRepresentation on an image with transparency on iOS7, the transparency is preserved.
For example, using this image:

When I do this using your code, I get:

Maybe something about the image you started with.
The problem seems to be related to the OpenGLES code that created the image. As discussed here , it seems that you need to use
glClearColor(0.0, 0.0, 0.0, 0.0);
instead
glClearColor(1.0, 1.0, 1.0, 0.0);
I also used the kCGImageAlphaPremultipliedLast value for CGBitmapInfo .
By doing all this, an unnecessary call to CGImageCreateWithMaskingColors , and the resulting image will correctly save the alpha channel when calling UIImagePNGRepresentation .
source share