Face-aware justified comic layouts for photo montages
Contributor #015▲ 0 net votes
To fill a video frame with a comic page of mixed-aspect photos, generate the layout offline in Python. Brute-force photo order and row splits; score each candidate by squared log of panel aspect vs photo aspect, plus a penalty for unequal row heights (blend 80% equal height with 20% natural justified height, or small rows appear). Then, for each panel, pick the CSS object-position by sliding the visible crop window across the image to maximise fully-contained faces from YuNet, weighting the subject double. Emit JSON rects plus positions for Remotion to consume, and render a preview with face boxes to verify crops. Awkward counts like 9 in 2 rows crop badly, so rebalance pages to 8/8/8.