png2swf: a way to keep transparency and small PNG file size

August 7th, 2011 by Piotr Wierzgała Leave a reply »

png2swf utility is a part of SWFTools package. It is capable of converting PNG to SWF format and it can really save your life if you are in need of having small PNG files.

PNG supports transparency and it has good compression for images consisting of solid blocks of colors but if it comes to photo-like quality PNG is really terrible. With png2swf you can combine transparency of PNG and small size of JPEG format. In order to compress your PNG image (with preservation of transparent pixels) you need to specify -j flag with it’s quality level (1-100).

png2swf -j 70 -o output_file.swf input_file.png

Here are several examples of my results (quality 70):

  1. 315KB (PNG) -> 58KB (SWF) output is 18% of input
  2. 294KB (PNG) -> 60KB (SWF) output is 20% of input
  3. 101KB (PNG) -> 29KB (SWF) output is 28% of input
  4. 193KB (PNG) -> 45KB (SWF) output is 23% of input
  5. 203KB (PNG) -> 72KB (SWF) output is 35% of input

If you are going to use this solution you may be also interested in the follwing two posts:

Advertisement

Leave a Reply

Flexmaniaks on Facebook