Photo Collage Algorithm

I am trying to create a script that will dynamically post collage-like photos, very similar to what is being done at http://lightbox.com/explore#spotlight .

I can not write code that would handle each case with different sets of photos, but I would prefer to have an algorithm that could handle any number of photos. The algorithm described 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 relationships would always be the same. I would define a bounding box and how many levels each node could be divided. The bounding box will have the same horizontal photo ratio. If the algorithm cannot match all the images, I would go back one level and leave it there or select another photo from the pool of available photos.

My question is very similar to this Algorithm. Arrange the images on the screen , but I'm not sure how to move forward. Any additional hints or pseudo codes will be very helpful.

+4
source share

Source: https://habr.com/ru/post/1386714/


All Articles