PNG losing transparency in iOS?

This area contains the messages from the old Yahoo gcmac group after the port.
Post Reply
Alexander von Below
Posts: 0
Joined: Fri Nov 23, 2007 1:55 am

PNG losing transparency in iOS?

Post by Alexander von Below »

Hello Torsten, hopefully this is an interesting question for the list, so I am asking this general question here: We are developing an application for iOS, and some of our icons lose their transparency when displayed on the device (even just as UIImages using Interface Builder). The problem does not occur in the simulator, and not with any applications on OS X. GC displays the transparency as expected (originally, the icons were created with a different software). When I edit the icons and set a new transparent color in GC, the transparency is restored on iOS. I have attached two files, Test-1.png is "good", "attachement_add_1.png" is "bad". Can you see any reason why "attachement_add_1.png" would lose it's transparency on iOS? Is there any way I can use GC to assure my icons work perfectly on iOS? Thanks a lot Alex
Carl von Einem
Posts: 0
Joined: Mon Jul 23, 2012 12:58 pm

Re: PNG losing transparency in iOS?

Post by Carl von Einem »

Hi Alex, just look at the EXIF data (available from the 'i' icon or via menu Window -> show Information) to see the difference between both files: Test-1.png: 699 bytes RGB with Alpha attachment_add_1.png: 1859 bytes RGB Transparency: 128 255 255 So the second file is lacking an alpha channel which stores the transparency mask. As a side note it also uses a flattened background layer whereas the first file isn't flattened but that's something you see easily in e.g. Photoshop. Needless to say that GC does a better / faster job of correcting this issue :-) Compare available options in menu Image -> alpha channel for both files... I also get a warning dialog for your "bad" file, maybe you switched that dialog appearance off. So my guess is that the bad image uses an index color (RGB values 128/255/255) as background color which is clearly detected by GC and honored by applications such as my browser. To make sure your icons also work on iOS as expected I'd use "generate alpha channel from transparency" for every affected file. Hope that helps, Carl Alexander von Below schrieb am 23.07.12 10:47: > We are developing an application for iOS, and some of our icons > lose their transparency when displayed on the device (even just > as UIImages using Interface Builder). The problem does not occur > in the simulator, and not with any applications on OS X. > > GC displays the transparency as expected (originally, the icons > were created with a different software). When I edit the icons > and set a new transparent color in GC, the transparency is > restored on iOS. > > I have attached two files, Test-1.png is "good", > "attachement_add_1.png" is "bad". > > Can you see any reason why "attachement_add_1.png" would lose > it's transparency on iOS? Is there any way I can use GC to > assure my icons work perfectly on iOS?
Post Reply