Loupe creates collages by taking a bunch of photos and moving them around on a page so that they form a shape. When arranging the photos, they should be evenly spread out and there should be as little overlap of the photos as possible, given the size options.
This sounds easy, but it’s actually a lot harder than it sounds. Figuring out how to perfectly place the photos is an “NP-complete” problem, which is Computer Science lingo for “really, really hard”.
Loupe uses a very fast patent pending method to arrange the photos in the collage. It’s not perfect, but it does a pretty good job. The basic idea is to throw a bunch of photos on a page and then, as you would if you did this with physical photos, spread the photos out so that they are as far apart as possible, while still staying inside of the shape. At first, the photos move around a lot, but then as the arrangement gets better, smaller adjustments are needed. The end result is a unique arrangement of the photos within the collage and no two collages are the same!
Math, trigonometry, logarithms, algebra, matrices, calculus, probability, energy-based gradient optimization, and other complicated stuff are all used by Loupe to create shape collages!
A few more: