title: Flex: Does the flex compiler automatically optimize embedded PNG assets?
body: <p>I was trying to further reduce the filesize of a SWF file by optimizing the embedded PNG graphics (using <a href="http://imageoptim.pornel.net/" rel="nofollow noreferrer">ImageOptim</a> tool). To my surprise, this didn't yield any effect, so I created two test Images:</p>
  
  <p><a href="https://i.stack.imgur.com/L2JZi.png" rel="nofollow noreferrer">Original</a> (433883 bytes)</p>
  
  <p><a href="https://i.stack.imgur.com/okhnH.png" rel="nofollow noreferrer">Optimized</a> (273723 bytes)</p>
  
  <p>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.</p>
  
  <p>Here's the Code for completeness:</p>
  
  <pre><code>package
  {
      import flash.display.Sprite;
  
      public class SizeTest extends Sprite 
      {
          [Embed("/assets/original.png")]
          private var ImageAsset:Class;
  
          public function SizeTest(){
          }
      }
  }
  </code></pre>