"3labs" Posts

Compiling ZaaIL with Alchemy – Part 1

This post is to help share the bits of knowledge we gained about Alchemy while porting DevIL to the Flash Platform. Alchemy is an ingenious tool that is used to port C/C++ code onto the Flash platform. There are some great posts out there about how it works, and some great ones about the speed benefits of Alchemy. However, that is not the focus of this series.

As I dove into the project of creating ZaaIL I realized that some more in depth walk-throughs on how Alchemy works may help make this great tool more popular. So in this series, I’m going to walk you through how ZaaIL was created from DevIL.

The first step is to go to the website for DevIL and download the source. Towards the bottom of the download page you’ll notice a section about libraries needed to compile DevIL from source, so we’ll need to download each of these as well.


DevIL Libraries Listing

Here is my folder, I’ve downloaded each of the libraries and unpacked them.

Library Folder Structure

The next step we’ll take is to download Alchemy and get it set up. Adobe’s guide on this is actually pretty good, so here is a link to that guide.

Once you’ve got your environment set up you should have available to you alc-on and alc-off. You’ll notice from the screenshot that these scripts modify your path. They add the directory ALCHEMY_HOME/achacks to the front of your path. The contents of this directory are perl scripts used to circumvent the normal C/C++ compilation tools. [ You heard that right... I think every project starts off as a bunch of perl scripts ].

You also need to note that you should have the bin from Flex SDK version 3.2 in your path. Which can be found here.

[WARNING] Don’t try to be smart and use a different version of the Flex SDK such as the current version 3.5… it won’t work as intended.

Also a special note, all of the paths to your Flex SDK bin and to your ALCHEMY_HOME should not have spaces. If you do have spaces in the path, it may manifest itself as this error “make *** [file_name.o] error 255″.


Path And Achacks Listing

That’s a lot just to get set up, but I promise we’re almost to the good part! In the next post we’ll go into exactly how to compile these libraries using standard C/C++ tools like the configure script and make.

Please feel free to post any questions in the comments. Comments are welcome too :)

ImageConverter – ZaaIL Example

Using ZaaIL (see our other post), we are now able to support the loading of around 40 image formats directly into Flash.

Full source included, and licensed under the MIT License.

[NOTE] ZaaIL is still in development… we haven’t been able to test every format yet… so some listed formats may or may not work.  If you have a supported file format that does not load properly, please send it to info [at] zaalabs.

Enjoy!

Get Adobe Flash player

Introducing ZaaIL – 40+ Image format support for Flash

:: UPDATE ::

We’re currently are testing a new Image Parser called ZaaTiff, we need your help.

:: ORIGINAL POST ::

Recently, I’ve been doing a lot of work with images and bitmaps… and I grew very frustrated with the lack of image support built into the player. After a having a conversation with my friend Ben Garney of PushButton Labs he pointed me to an open source image library in C called DevIL (originally OpenIL).

Today I’m extremely excited to announce that by using Adobe’s Alchemy toolset we have a working port of DevIL on the Adobe Flash Platform! This means that we now have support for 40+ image formats in the Flash Player. And yes… it works in both Adobe AIR as well as Flash Player.

The port was done by Aaron Boushley and Nate Beck of ZaaLabs.

Best news of all… we are releasing ZaaIL under the MIT License!

Supported Formats

  • Blizzard game textures – .blp
  • Windows Bitmap – .bmp
  • Multi-PCX – .dcx
  • DirectDraw Surface – .dds
  • Dicom – .dicom, .dcm
  • Flexible Image Transport System – .fits, .fit
  • Graphics Interchange Format – .gif
  • Radiance High Dynamic – .hdr
  • Macintosh icon – .icns
  • Windows icon/cursor – .ico, .cur
  • Interchange File Format – .iff
  • Interlaced Bitmap – .lbm, .ilbm
  • Infinity Ward Image (doesn’t work with MW2 iwi files) – .iwi
  • Jpeg – .jpg, .jpe, .jpeg
  • Jpeg 2000 – .jp2
  • Homeworld texture – .lif
  • Half-Life Model – .mdl
  • MPEG-1 Audio Layer 3 (Amazon MP3s work, Apple’s do not) – .mp3
  • Kodak PhotoCD – .pcd
  • ZSoft PCX – .pcx
  • Softimage PIC – .pic
  • Alias | Wavefront – .pix
  • Portable Network Graphics – .png
  • Portable Anymap – .pbm, .pgm, .pnm, .pnm
  • Adobe PhotoShop – .psd
  • PaintShop Pro – .psp
  • Pixar – .pxr
  • Raw data – .raw
  • Homeworld 2 Texture – .rot
  • Silicon Graphics – .sgi, .bw, .rgb, .rgba
  • Sun Microsystems, .sun
  • Creative Assembly Texture – .texture
  • Truevision Targa – .tga
  • Tagged Image File Format – .tif
  • Gamecube Texture – .tpl
  • Unreal Texture – .utx
  • Valve Texture Format – .vtf
  • Game Archive – .wad
  • Quake 2 Texture – .wal
  • Wireless Bitmap File Format – .wbmp
  • HD Photo – .wdp, .hdp
  • X Pixel Map – .xpm
  • Doom Graphics

Features currently supported:

This is just our first cut of ZaaIL, therefore it is not on full parity with the features in DevIL yet (it may never be)… but it’s a start.

  • Decoding 40+ image formats
  • Access to the image bitmap data

Features planning to be supported:

  • Support for encoding bitmap data to 20+ image formats
  • Palette swapping

Get It Here

See it in action

We’re planning to put ZaaIL up on GitHub.

ZaaIL is now available on GitHub

ZaaIL on GitHub

Test Images for ZaaIL on GitHub

You can still download the source –> here.