Programmatically arrange rectangular UI objects in an abstract way, without gaps
Given a collection of say, 50, images with various widths and heights, how would one go about programmatically arranging them in an interesting* abstract way? (see image below)

![enter image description here][1]

* By interesting I mean, no large gaps, and no easily distinguishable rows or columns (negative space forms a lot of T-like intersections).

For my specific case, all images have a set max dimension of 150px, which could mean the height OR width is a max of 150px (could be 150px by 450px, or 378px by 150px).

This seems like it could be a classic programming challenge but I'm finding the topic hard to Google...


  [1]: http://i.stack.imgur.com/1HyTE.jpg
Programmatically arrange rectangular UI objects in an abstract way, without gaps
===

Given a collection of say, 50, images with various widths and heights, how would one go about programmatically arranging them in an interesting* abstract way? (see image below)

![enter image description here][1]

* By interesting I mean, no large gaps, and no easily distinguishable rows or columns (negative space forms a lot of T-like intersections).

For my specific case, all images have a set max dimension of 150px, which could mean the height OR width is a max of 150px (could be 150px by 450px, or 378px by 150px).

This seems like it could be a classic programming challenge but I'm finding the topic hard to Google...


  [1]: http://i.stack.imgur.com/1HyTE.jpg