January 12, 2005

Flash Lite and Alpha Transparent PNGs

I was recently working on a little Flash Lite (1.0) project targeted at DoCoMo 900/901 handsets and came across something odd with PNG files.

In the project I had a small animation created from an imported sequence of alpha transparent PNG files, which were exported from Swift 3D 4. After importing into Flash, everything looked fine, but I wanted to do some minor touch up work in Photoshop. After completing revisions and updating the library items in Flash, I exported the SWF (flash lite 1.0) and uploaded to our test server. While the animation appeared as expected on a PC, those "slides" I edited in PS displayed on the mobile phones with a black background.

At a loss for what was happening, I started to backtrack to figure out what was different in the edited files. Both were exported as PNG with alpha transparency. The difference was, by default Swift exports 32bit PNG files with alpha transparency, Photoshop only exports up to 24bit. I had not read anywhere in the Flash Lite (for DoCoMo) docs that this was an issue, but, I guess it is.

The fix was to open the PS exported PNG docs in Macromedia Fireworks and export as 32bit. Problem solved!

I'm not sure if this happens on any other devices that support Flash Lite, but hopefully it helps someone out of a bind.

Posted by Kris at January 12, 2005 02:32 PM
 



Comments

Sure it helps.

By the way, I suffered a similar problem a few days ago with some pngs exported from photoshop and that I wanted to use in a j2me app.

I'll try the "Fireworks solution".

Posted by: Cesar Tardaguila at January 12, 2005 09:49 PM

isn't the extra 8 bits of data in a 32 bit file the alpha channel?

at least that's what my Director training led me to believe.

Posted by: chadvavra at January 13, 2005 03:28 AM

I was always led to believe that 24 bit PNG files with alpha transparency were the same as 32bit and this is the first time I have seen something like this happen. Perhaps it is the way in which Photoshop encodes PNG. If anyone has a technical explanation for the problem, I would love to hear it!

Fireworks and Swift list their PNG fils as 32bit, while Photoshop states 24bit(with transparency). Simply a difference in description I think..but it seems to make a difference in this case...

A little reference to color bytes in image formats.
http://www.willamette.edu/~gorr/classes/GeneralGraphics/imageFormats/

Posted by: Kris at January 13, 2005 07:48 PM

Yup, i had this problem with regular flash (exporting for player 7) and transparency a while back. I was working straight from fireworks and I didn't get transparency until I exported as 32bit.

Posted by: Matt Turner at February 14, 2005 06:49 PM