I just finished writing a small script to combine a lot of png pictures into a bigger one for CSS Sprite.
So basically, I have a list of dimensions [(w1,h2), ..., (wn,hn)] and I need to put them into a frame with dimension (W,H) with WH as small as possible. (Of course they cannot overlap)
The heuristic I used is obviously not optimal. I was wondering if you had any ideas on the subject? Do you think some smarter constraint, like grouping images with similar histograms would make the png smaller?