This is a Rust port of the potpack algorithm for packing 2D rectangles.
Blog post
Original JS implementation
As mentioned in the original implementation README, is not the most optimal algorithm (it might waste like 7% of your texture), however it's very simple and fast.