lil

Download

Download v 0.12 here.

License

lil is released to the public domain with a license very similar to the one found at [http://unlicense.org/].

What is it?

"lil" stands for little-image-loader (though it saves them too). It has sort of been my playground for learning (simple) codecs, practicing implementing simple specs, and satisfying my curiosity about things most sane people would never get into. Use it however you want for whatever purpose you want. It is my hope to one day develop lil into a full features image library with absolutely no restrictions.

There are many very good image file format libraries out there, but none of them really fit all the criteria I needed:

- Useful for the general case. You should be able to have 16 bit channels or floating point channels, for example.
- Easy to plug into other libraries or software. You need minimal glue code for game engines, image processing frameworks, etc.
- No external dependencies - you don't have to worry about other libraries! (Yes this has its good and bad points.)
note that I no longer need this "purity" and am currently using a couple other public domain sources
- An ongoing platform to learn about various specs and algorithms - zip, png, jpg, to name just a few.
- Public domain. You can do what you want with it without worrying about license obligations.
- Multi-platform or easily modified to better support more platforms as the opportunity arises.

With that said, I give no guarantee that there is anything useful or safe to you in any way in the code.
No warranty implied. Use at your own risk.

Alternatives

In almost any and every situation, one of the following will be a safer, smarter bet:
- Intel UIC: Commercial. Fast. Well tested. A bit complicated to initially use in software.
- FreeImage: GPL/FIPL + licenses of all wrapped libraries. Wraps libpng, libtiff, libjpeg, libmng, zlib, and others. Windows, Linux, Mac. Supports numerous formats. Customizable I/O. Uses mature, standard libraries. Many dependencies. Large footprint.
- stbi: Public Domain. Fairly well tested for predictable images. Tiny footprint. Designed for games and apps where you control the images.
- Others: Most other open source libraries are similar to FreeImage in purpose and build.

Acknowledgments

- stbi - This library was very useful when debugging parts of lil, especially with jpeg images (but also with png and deflate). I am amazed how the author Sean Barrett implemented the jpeg decoder in 14 hours. It took me a good week or two to understand and implement it - and that is with his library being used to help debug things I got wrong initially.
- jpge - Designed primarily by Rich Geldreich. For jpeg encoding, lil will use a modified version of this library, which is also nicely public domain. One day I may give it a go, but for now this will work great!
- miniz - Same guy as above, zlib replacement. I doubt I will ever get around to implementing dynamic huffman codes, and this is very functional. Thanks Rich!
- Most of all: All the people who took the time to write the many (many, many) specifications for image file formats and compression algorithms that are out there!

Features

- Public domain, cross platform, image file format i/o
- Loads and saves JPG, BMP, GIF, PSD, PCT, PNG, ICO, CUR, TGA, PNM, PGM, PBM, PPM, TIF, AVI, APNG, DDS
- Access to various basic (de)compression algorithms - deflate, lzw, more
- Configurable I/O, Memory allocation, other internal details
- Automatically converts to many different color spaces and bit depths as requested (allows 16 bits per channel, various channel ordering, etc)
- Multipage support
- Very lightweight
- Examples for SDL2 and WxWidgets

Changes

v 0.12
- Many bug fixes
- Now uses miniz and jpge because they are pretty full featured and well debugged
- Slight changes to ensure a fully C compatible interface

v 0.11
- Png heuristic filtering

v 0.10
- Initial release. Development build.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License