I don't understand how this is possible. I made this banner based on the design of another one. I've been struggling getting decent quality. I notice the quality is pretty good in the one I'm copying. I decompiled and saw that the images alone are 125kb. This is bizarre because the total size of the swf is only 45kb. What the hell is going on here?

  • While this is an interesting question, it's really about file compression and/or the makeup of SWF files, so I'm not sure it belongs here.
    – e100
    Jul 1 '11 at 7:57
  • I'd say this is on–topic: for a graphic designer it is crucial to have a good-looking design, and file compression in the design workflow is commonplace in digital media—especially for the web. Jul 1 '11 at 10:18
  • 1
    One thing to keep in mind is that when an image is in a container format such as SWF, the container can do other things besides compression. One potential file size optimization strategy is to throw away the file headers and only store the channel data. Because the header is often a fixed minimum size, plus room to expand based upon need, on smaller files this might give one the impression that the file size has changed dramatically.
    – horatio
    Jul 1 '11 at 13:54
  • 1
    A second thing to consider is that what people consider file formats (PNG, JPG) are file STORAGE formats. In a container format like SWF, it may be stored in an arbitray, non-standard manner and only becomes a PNG etc when exported.
    – horatio
    Jul 1 '11 at 13:54

It seems that if the source PNG file is too big (and in this case, even 25 kB seems to be "too big"), Flash decides to use JPG compression on the imported file by default.

The default amount of JPG compression is defined under Publish Settings…FlashImages and Sounds.

The compression can be overridden by–object basis through the Library window to either different amount of JPG compression or to lossless PNG/GIF "compression":

  • Choose the bitmap file you want to edit from the Library
  • Right click → choose Properties…
  • Click OK
    • If you want to preview the results, click Update and review the results

Bitmap Properties window

Note that the original PNG is 25 kB and Flash reports its lossless file size as 135.6 kB; it may be the case that Flash will base its calculation to a redrawn bitmap.

This might answer your question — or not. I noticed that a SWF file containing just the PNG image (25 kB) results in a file size of 16 kB. (For what it's worth, a SWF file containing the same PNG image, this time compressed with 97 JPG compression, results in a file size of 20 kB (well, the increase was expected))

So Flash does some abracadabra in between of which I currently have no idea; but changing the default compression to your liking might solve the crippled image quality of your SWF output.

  • 1
    Fantastic. Problem solved. The whole reason I was using PNG was for it transparency. I had seen the bitmap properties dialog but assumed if I converted to jpg I would lose the transparency given jpg doesn't support it BUT apparently flash will actually preserver it by (i'm assuming) making anything that has color info a jpg and leaving everything else in the image that's transparent a png or gif. Thanks for all the replies! Jul 1 '11 at 19:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.