This is useful for creating texture atlases, sprite sheets, or just making some neat generative artwork.
This is implemented with binary tree bin packing. In the tests I've run this uses on average 80% of the space available. Pull requests are welcome if you want to improve upon this!