:: 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
We’re planning to put ZaaIL up on GitHub.
ZaaIL is now available on GitHub
Test Images for ZaaIL on GitHub
You can still download the source –> here.
great work!
Wow – that looks very useful indeed. Thanks a lot for porting it!
Wow, brilliant, excellent work. Thanks so much for porting and sharing it.
Loving the opportunities alchemy brings to the platform! Nice work
Amazing work! Thanks for sharing!
Amazing. Great work!
Awesome! Nice work!
Wow, I’ve been waiting for someone to figure this stuff out! Thank you!
nice, but the sample doesn’t work with jp2 file format.
@nico
Hey Nico, thanks for stopping by!
We don’t have copies of every file format to test with. Could you send your jp2 file to info [at] zaalabs [dot] com? I’ll make sure to get it working.
Cheers,
Nate
Exciting and promising library. Great, now I only need to find a reason to use it…
Amazing work. That will come in really handy. PSD files in flash? wow!
Great library, just wow! Thanks for sharing this with the community. What was the hardest part in porting DevIL to Alchemy?
@Ferdi
We documented the whole process of porting DevIL, and will be releasing a series of posts walking through it. But the hardest part I would say was figuring out how to link in the dependencies: libjpg, libpng, etc…
Cheers,
Nate
Yeah… I used DevIL in a game engine during college. Getting all of it to link properly was a major pain. Good work with this man.
Sweet! DDS support could get interesting
Great work! Thanks for porting and sharing!
Wow, great work guys! We’ve been working on a resizing uploader utility and this might provide some great new capabilities. Quick note on the demo (on Intel Mac) – .tif / .tiff files are not selectable in the file browser.
My main point of curiosity is which of these formats are actually used, say by professional photographers. Tiff and PSD are two that stand out (and we’d probably throw in BMP for good measure). Besides maybe Targa or Pixar I’m not sure if any of these other formats get any play? Which is not to say that having them wouldn’t be super useful in specific cases! Just asking if you guys have any recommendations on formats that might get used quite often but just aren’t as well known?
My other question regards Tiff and BMP – there are already a few decoders for these online, but none of them has fully finished the job of handling all the various types of compression that can be used within these formats. We wouldn’t want to enable them in the browse dialog if there’s a partial chance of failure at the decoding step. Any specifics on the range of your Tiff and BMP support would be much appreciated.
Thanks again, really great project!
A couple more comments:
I know pro photographers probably use a lot of different RAW formats (.raw is not common, it’s simply Panasonic raw – see http://en.wikipedia.org/wiki/Raw_image_format), but not sure Flash would be able to handle processing such large files.
In general one of my biggest concerns with being able to load images into Flash for decoding is memory management. There’s not any reliable way for the player to sense when it’s running out of memory, and there’s a risk of crashing the user’s browser from overloading it. It’s nice to say that Tiff is supported, and it may work well on most computers, but a low-RAM system might barf. That’s a hard one to test as well.
There is an open source RAW decoder that I wanted to bring to your attention in case it’s something you’re considering experimenting with. http://en.wikipedia.org/wiki/Dcraw
@Moses
Thanks for stopping by and for the great comments.
It seems like we forget to link in libtiff to that version of the swc.
ZaaIL actually came together out of a need for multiple file support for game development tooling on the Flash platform. As you can see many of the supported formats deal with games. Obviously this is one of those situations where one man’s trash is another man’s treasure.
You’re absolutely right! We haven’t done much yet in terms of performance, error handling and optimizations. That’s next on the list of things to do with ZaaIL. That and encoding support.
Cheers,
Nate
@Ferdi
Personally I thought the hardest part was finding my way around all the bugs. That’s why we’re releasing the post, to show others how to navigate the maze of bugs.
Linking in the other libraries statically was definitely an interesting thing to attempt, since I’m not very familiar with C’s linking step. And the reason we can’t use normal shared libraries is due to another bug!
Alchemy is great, but it could definitely use some polish work.
Thanks for the replies Nate. And hi from my boy Jolma
I sent jp2 images 2 days ago. Did you receive it?
Dicom doesn’t seem to work.
@Eric
Can you please send the Dicom file to info [at] zaalabs [dot] com.
We’re currently collecting all formats so we can test properly. We dont’ have dicom files yet.
Cheers,
Nate
double thumbs up!!
wicked!
“Features planning to be supported:
* Support for encoding bitmap data to 20+ image formats”
Wow that would be amazing! Will it include multilayered files ? like multilayered psd or multilayered PNG. I would be very interested in that!
Else Great work guys!
I guess the next step now is to be able to export from flash using vector formats like SVG or illustrator files etc…!
Looks great and would love to use it. Where is the source for the swc?
Hey Justin,
The source code is in C, and then ported using Adobe Alchemy. This means the that SWC doesn’t have any actual ActionScript source code. We have a series of posts that talk about this process.
Compiling ZaaIL With Alchemy Part 1
Compiling ZaaIL With Alchemy Part 2
Compiling ZaaIL With Alchemy Part 3
… lol never mind found your Alchemy 3 part post…. now the fun begins.
Hi
I was looking for support of 16 bit tiff images but couldnt load them. Since this is kinda urgent, could you offer some help?
Hey Vineet,
I believe the current ZaaIL only has support for 32bit images. There are tutorials on this website that walk you through how we built the swc (the first in the series can be found here http://www.zaalabs.com/2010/04/compiling-with-alchemy-1/). There is a point where we have to pass the number of bits per pixel.
Right now our plates are pretty full at ZaaLabs, and the Alchemy projects are experimental and thus time consuming. If you want to discuss hiring us to help you on this, send us some mail through the contact page.
Aaron
i need to load tiff images, plis help meee!!!!!!
thanks
Hey juZt, as Aaron mentioned above.
Cheers,
Nate
Does it do animated gifs?
The test app doesn’t seem to animate it
@Stu
It does not support animated gifs, you can achieve animated gifs by using this library however: http://www.bytearray.org/?p=95
The image loading is really really slow… C/C++ code should be faster but I really like the project but it needs to be polished. I found the following runtime errors:
1) calling lib.ilInit();
RangeError: Error #1506: The specified range is invalid.
at cmodule.zaail::FSM_imalloc$/start()
at cmodule.zaail::FSM_pubrealloc/work()
at Function/()
at Function/()
@Richard
ZaaIL is not optimized. It was a week long experiment that we published the results on. We currently are not doing any development on it, but that is why we gave away all of the work we did, and wrote a series about how to compile it yourself.
Cheers,
Nate
I think you are trying to init the lib more than once.
var libLoader:CLibInit = new CLibInit;
var library:Object = libLoader.init();
i’ll get that error usually when i put the above two lines in a loop or call them twice unknowingly.
Hi Nate,
Great work! I was just trying out the example and it didn’t support tiff images. Is this something that is not currently supported in this library.
.tif file is not working… it is possible to get it working? i read somewhere that you forget to embed the tiflib…. i don’t know a lot about alchemy … i don’t know if it would be easy but it would be a awesome add-on for my project.
Thanks Nate,
Paul
Zaail is a amazing tools which can support so many file formats.
However, when I load a TIFF file, a error ”
Undefined sym: _TIFFSetWarningHandler
at Function/()
at Function/()
at ImageConverter/onFileLoaded
\ImageConverter\src\ImageConverter.mxml:81]
Even I download the test TIFF files from GitHub, the same error happens. Any thing needs to modify to support TIFF ?
Please advise.
Thanks.
Billy
Very interesting but DICOM doesn’t seem to work… I think a lot of hospitals could be interested.
Why can not open the file name with Chinese?
awesome. No animated gif’s though
Awesome project man, you should definitely support adobes .atf format too when it gets released
I have this error with a JPEG is loaded by zaail:
Error: Error # 1502: The execution time of a script exceeds the default time (15 seconds).
at cmodule.zaail: FSM_ilConvertBuffer / work ()
at Function / ()
at Function / ()
at net.primaire:: upload / onFileLoaded ()
Someone has the same?
What is the solution?
thank you
Hi,
Any plan to support OpenEXR soon throught the ZaaIL package? DevIl already support it.
Thanks
Hello Zaa Team!
First thanks for this library and the original code, it comes really handy!!
I have a memory leak and would like to know if there is any way to explicitly release memory.
Any method? or is there any docs? I couldn’t find any…
Thanks in advance!
Bruno
I think this library caches files, Meaning if files change outside of flash it loads them in the state it loaded them before – so it doesn’t work with files that change
Anyone else noticing this?
Since this was a weekend project, I don’t recommend using this in production.
However, you could work around your problem by modifying your loader.supplyFile call. Subsequent calls to the supplyFile with the same string will not overwrite the bytes set in that space. Just change ref.name to something else if you want to reload an image, the only thing that matters that the first parameter of supplyFile matches the parameter you pass into ilLoadImage.
loader.supplyFile("foo", fileContents);lib.ilLoadImage("foo")
I used an id of:
file.name + “_” + file.modificationDate.toString();
and that seems to work, just worries me a bit that it doesn’t flush the bytes it loaded. Btw. I am using this for ShoeBox to load in mainly PSD’s as it simplified the workflow as opposed to exporting assets to PNG assets for example.
http://renderhjs.net/shoebox/
do you have any references on how to construct or create a PSD file with slices or guide lines? any of those meta data that could be set. I’d like to use the PSD parser to generate PSD files with pre-set slices.