Quick tip: Fastest ActionScript PNGEncoder (update)

Here are some benchmark tests for current available PNGEncoders. Sync encoding tested on 2 real bitmap images (500x300px, 256x256px) on Intel Core 2 Duo @ 2.80GHz, win XP:

encoder / image                         500x333 px  256x256 px
by.blooddy.crypto.image.PNG24Encoder     78ms       125ms
dsk.PNGEncoder							140ms		141ms
net.kaourantin.PNGEnc					188ms		187ms
mx.graphics.codec.PNGEncoder			203ms		172ms
com.adobe.images.PNGEncoder				219ms		172ms
org.aswing.image.png.AsPngEncoder		234ms		172ms
ru.inspirit.encoders.png.PNGEncoder		391ms		203ms

by.blooddy.crypto.image.PNG24Encoder worked fastest for me.

Update Nov 15, 2011: There is a new worth to try async and superfast encoder from Cameron written in HaXe called PNGEncoder2.

Check out some more benchmarks from Blooddy and Cameron.

Read the rest of this entry »

Inline Images

Have you ever heard about inline images? Inline images use the data URI scheme to embed images directly within web pages. As defined by RFC 2397, data URIs are designed to embed small data items as “immediate” data, as if they were referenced externally. This basicaly means, you can insert base64 encoded byte code of any image directly into html file. Using inline images saves HTTP requests over externally referenced objects. Data URIs can potentially store any type of data, not just images!

Read the rest of this entry »