I am trying to build a script that will dynamically arrange photos like a collage very similar to what is done on http://lightbox.com/explore#spotlight.
I can off course write code that would handle each case with different sets of photos but I would prefer to have an algorithm that would be able to handle any number of photos. The algorithm explained here http://www.hpl.hp.com/techreports/2008/HPL-2008-199.pdf in chapter 4 seems very similar to what I need to do. In my case the vertical and horizontal ratios would always be the same. I would have a defined a bounding box and how many levels each node could get split. The bounding box would have the same ratio of a horizontal photo. If the algorithm can't fit all images I would go back one level and leave it there or pick another photo from a pool of available photos.
My question is very similar to this one Algorithm Arrange images on screen but I am not sure how to move forward. Any further guidance or pseudo code would be very helpful.