Closed hisnameisjimmy closed 10 years ago
@hisnameisjimmy I think will better use this module for packing images https://www.npmjs.org/package/layout
I'm totally cool with whatever gets the job done. This is a great plugin and I love it, but bin packing would be amazing.
The layout package looks great. I will look into integrating layouts in the next days.
Awesome! Great to hear.
Any word on integrating bin packing?
Any news here? Binary tree packing would be a really great enhancement.
Hey, sorry I was on vacation the last weeks and now I am filled up with work. But I try to get on it as soon as possible.
No worries, excited to use it when it comes out!
This is a formal request for binary-tree packing. Right now this plugin only generates vertical and horizontally packed sprites, which when generating retina images can run into issues with overall texture size. If the sprite map is too large, iOS will either downscale or not render the sprites.
However, with binary tree packing, you could allow the sprites to take up the smallest overall area. Spritesmith does this well, but their tool makes generating retina sprites much more of a hassle. With css-sprite, I can just watch an image directory with gulp, and when something is added the sprite and relevant css is updated without any intervention on my part. It's a beautiful plugin, if only it could do binary-tree packing.
You can see an example of the image size problem on iOS here: http://weedygarden.net/demos/hi-res-retina-sprites/ and an explanation of the size issues here: http://weedygarden.net/2012/04/hi-res-retina-display-css-sprites/
A bin-packing algorithm that may be useful: https://github.com/jakesgordon/bin-packing