Hidden Marvels in Flash: Jpegs with Transparency

– taterboy | September 11th, 2010

Filed under: Design, Flash, Flex, Games, Tutorials

Ever need a compressed bitmap file with 24 bit transparency, but with the application being delivered over the web, you also need that file to be small? Gif files only have 8bit – aliased transparency and a 256 color limit. 24bit png files have transparency, but are lossless and are often produce large file sizes. Jpegs are perfect compression-wise but do not include transparency, or do they….

The Solution: Flash
Import your 24-bit transparent png into Flash and Double-click no the file in the Flash project library.

Set your compression settings to jpeg at the quality settings of your choice, also set to smooth if you are planning on scaling or rotating the image. You could also set a global compression setting in File > Publish Settings > Flash tab. Now publish your file and you will get a swf with a transparent image using jpeg compression that is much smaller then a png. In this test, compressed at 70% quality the swf was just under half the size of the original png, even with an animation included.

1. For anything you need 24 bit transparent bitmaps in Flash.

2. Convert each bitmap to a MovieClip symbol and use the Flex Component for Flash toolkit to convert each image into a Flex component. Export the swc and place it in the libs folder of you Flex project. Now you have compressed bitmap images with 24bit transparency for use in your Flex project, at a faction of the size.

The Demo:

Get Adobe Flash player

Technorati Tags: , , , , , , , ,

| 1 Comment » | facebook:

1 Comment »

  1. Fantastic creation ! I am going to try this out soon.Thanks for sharing .

    Comment by bellakristen — April 29, 2012 @ 9:33 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment