bgrins / InstantSprite

A fast browser based CSS Sprite Generator
http://instantsprite.com
MIT License
141 stars 29 forks source link

Feature Idea: 2D bin packing #1

Open bgrins opened 13 years ago

bgrins commented 13 years ago

Use or implement something like this: http://incise.org/2d-bin-packing-with-javascript-and-canvas.html to get optimally place icons on a grid in addition to vertical/horizontal/diagonal options. Would this be worthwhile? Seems like it could help squeeze everything into place if you were planning on using fixed width/height elements to display the sprites.

bgrins commented 13 years ago

These might be useful links too: http://blog.tabini.ca/2010/09/optimized-image-display-using-a-bin-packing-algorithm-part-one/ http://blog.tabini.ca/2010/09/optimizing-image-display-using-a-bin-packing-algorithm-part-deux/ https://github.com/mtabini/Boxer/tree/raw-fit

bgrins commented 13 years ago

http://www.codeproject.com/KB/web-image/rectanglepacker.aspx

This actually looks a little more like the type of tool needed (since we don't know the desired output width/height, just want to minimize it)