As a twin brother to the sheet generator, here's an atlas generator too.
https://gitlab.com/bztsrc/spratlas
Features:
- Input can be in any image format that stb_image understands (png, jpg, tga, bmp, pbm, etc.)
- If input is a directory, then it is recursively parsed for image files
- Uses Sean Barrett's rectangle packer, which in turn uses the Skyline algorithm (decently compact results at good speed)
- Output atlas is automatically saved as an indexed PNG if it uses no more than 256 colors (lot smaller and more efficient)
- Meta info is saved as a JSON string, into the atlas image (no more loosing the meta info file!)
- Works with any PNG library, example code on how to retrieve the meta info provided for libpng, lodepng and stb_image as well.
The code is written in ANSI C and dependency-free, meaning it should compile on any POSIX-compliant systems as-is without any trouble (just run make), but I've also provided pre-compiled portable executables for Linux and Windows (no .so/.dll required, no installation necessary, just download and use).
Cheers,
bzt