Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The bin packing problem is NP-hard, but rectangle packing is "merely" NP.

However, most people just use a recursive biggest-fit-first ¹), a simple heuristic that is surprisingly hard to beat for most workloads.

I couldn't figure out what Aseprite is doing from their website or documentation, but if it's not that then it might be worth it writing your own sprite packer.

¹) https://codeincomplete.com/articles/bin-packing/



Yeah I don't know what they use either, but so far repacking that atlas has not been frequent enough that writing my own packer would save time.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: