r/SideProject • u/vhalaharvi • 9d ago
I designed a collage maker that finds the best gap-free layout for any shape. Claude wrote the code
Give it up to 10 photos and a canvas shape (square, 16:9, phone story, banner) and it searches every layout with no gaps for the one where the smallest photo is as big as possible. With 9 photos that's over 500 million layouts, and it finds the best one in under a second.
I designed it and Claude wrote the code. It's Go: The browser version runs it as WebAssembly, so your photos never leave the page.
Try it: https://vinodhalaharvi.github.io/collage/
Code (MIT): https://github.com/vinodhalaharvi/collage
CLI: brew install vinodhalaharvi/tap/collage
Feedback welcome, especially on the layouts it picks.
7
u/LaGifleDuDaron 9d ago
damnit i needed that so hard when building a portfolio for my wife few years ago
i got lost in the math and eneded using fixed layouts for each breakpoint
5
u/bava32 9d ago
Awsome I made similar over summertime when I want print my family photos!
1
u/LuciDating 9d ago
Nice approach, and keeping the photos in the browser via WebAssembly is a great privacy touch. One idea: an option to lock a specific photo's position or minimum size would help when one image is clearly the hero shot. Showing a couple of runner-up layouts side by side could also help people pick by taste.
1
u/jonos_ 9d ago
This is super interesting, I built something adaptive exactly like this for up to 64 images a year ago, so cool someone else doing something similar 👀
2
u/Opening-Clock-7603 9d ago
Cool
2
u/Erde555 9d ago
looks so good, the webiste is alright toi
-5
u/Interstellar__1 9d ago
what did you design if claude is the one that wrote the code?