ActionScript PNG and JPEG Encoders Updated

In October of 2005, Tinic Uro ported a PNG and a JPEG encoder to ActionScript 3. Shortly after, we added both to the collection of free ActionScript libraries on Adobe Labs. Tinic wrote them for an early alpha release of Flex Builder, so at some point along the line during the evolution of the compiler and the player, they stopped working.

I just checked in new versions of both that now compile and pass simple tests against the Flex 2 release. The PNG encoder is here, and the JPEG encoder is here. Let me know if you find any problems with them.

13 Responses to ActionScript PNG and JPEG Encoders Updated

  1. Dominick says:

    Thanks Christian, great work!

  2. dmendels says:

    Nice. Not sure if you noticed, but James just posted an app that shows this in use: stuff._David

  3. weni says:

    change all “int” to “Number”,it will faster

  4. Matt Rix says:

    You can see Tinic’s encoding code in action on my Flex Derby project, Artmatic. it out, let me know what you think… I’m not even sure it works with the Flash 9 release player 😛

  5. Very cool but can you put these files up as usual download links? When trying to copy and paste the code, the formatting and tabs are completely messed up.

  6. … Besides on Firefox it also copies the line numbers so it’s completely in vain.

  7. sh0ckwav says:

    Am I the only one getting errors with the JPGEncode class? Which didn’t appear to be updated in the latest Is BitString still a class in AS3? I think that needs to be addressed for this to work properly.

  8. Whats the deal? I’m trying to copy these classes now since a few days but it seems nobody took notice that they cannot be downloaded (I’m getting here.html). And copy/paste doesn’t work. In Firefox it copies the line numbers too and in IE the code is still messed up that not even Flash 9 Public Alpha can reformat it.Anyone cares to correct this?

  9. Christian Cantrell says:

    For those of you having trouble getting Labs code, see this post: is explained.Christian

  10. andrea says:

    download works fine now! thxgreetz andreap.s.: next time call it a “download contest” and give hints like in an adventure game.working title: “distaction for the stressed out developer” 😉

  11. Very helpful. This stuff should be posted in more places. Also, more mention should be made of the as3corelib! This is very useful stuff.

  12. Marcus says:

    At first I thought BitString doesnt seem to be valid AS3.What is going on here?But then I realised there is a BitString class next to the other adobe classes. (Jpeg and PNG)You can see the BitString class here

  13. Yuri Visser says:

    I just completed a tutorial using the AS3 CoreLib JPGEncoder class. You can check it out at www[DOT]theliblab-tutorials[DOT]com.Any comments greatly appreciated 😉