I was trying to further reduce the filesize of a SWF file by optimizing the embedded PNG graphics (using ImageOptim tool). To my surprise, this didn't yield any effect, so I created two test Images (get them here: http://www.filefront.com/16902865/images.zip):
Original (434kb)
Optimized (274kb)
When embedding either of these assets in a simple ActionScript project, the compiled SWF is 274kb in size. Which raises the question: Does Flex optimize embedded PNG assets during compile-time? If yes, is there some documentation about the optimization going on? It can't be because of the SWF compression alone, because zipping the images doesn't reduce filesize at all.
Here's the Code for completeness:
package
{
import flash.display.Sprite;
public class SizeTest extends Sprite
{
[Embed("/assets/original.png")]
private var ImageAsset:Class;
public function SizeTest(){
}
}
}