문제

There are images (literally, PNG files), they come in different sizes and need to be put together into a larger image, so that (1) they don’t overlap, and (2) the amount of unused pixels is minimal.

Can someone point me in the right direction? I can imagine that packing rectangles is nothing new, but honestly, I cannot find neither an implementation nor an algorithm for this.

도움이 되었습니까?

해결책

This is one algorithm: Fast optimizing rectangle packing algorithm for building CSS sprites. The article includes an explanation and C# code. It also links to a paper that might be interesting.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top