kmelve 3 hours ago
Rosti's approach uses three things: proportional normalization based on aspect ratio, pixel density analysis (so a dense wordmark doesn't visually overpower a thin logomark), and a center-of-mass calculation for optical alignment. The perceptual sizing math builds on Dan Paquette's earlier work.
The core normalization logic is plain JS with no React dependency: https://github.com/sanity-labs/react-logo-soup/blob/main/src...
Someone already forked it into a framework-agnostic version: https://github.com/auroris/logo-soup
Rosti is around if there are questions about the density compensation or optical alignment math.