process() parameters (vanilla JavaScript).
Core Options
Array of logo URLs or objects with
src and optional alt text.Target size in pixels. This is the reference dimension that the normalization algorithm uses to scale all logos.
The actual rendered size will vary per logo based on aspect ratio and density compensation.
baseSize is the target, not a fixed size.Controls how aspect ratios are normalized. This implements Dan Paquette’s technique for balancing wide vs tall logos.The formula used is:
0= Uniform widths (all logos same width, heights vary)0.5= Balanced appearance (recommended default)1= Uniform heights (all logos same height, widths vary)
Density Options
Enable density compensation to scale dense/bold logos down and light/thin logos up for visual balance.When enabled, Logo Soup measures the pixel density (visual weight) of each logo and adjusts sizing so that bold logos don’t overpower light ones.
Controls the strength of density compensation. Range:
0 to 1.0= No density compensation0.5= Moderate compensation (recommended)1= Maximum compensation
Only applies when
densityAware={true}. The algorithm normalizes density around a reference value of 0.35 and clamps adjustments between 0.5x and 2x to avoid extreme scaling.Content Detection Options
Crop whitespace and padding from logos before normalization. Useful for logos with inconsistent padding.When enabled, Logo Soup:
- Analyzes each logo to find the actual content boundaries
- Crops to the content bounding box
- Normalizes based on the cropped dimensions
Minimum contrast for content detection (0-255). Pixels with contrast below this threshold are considered background/padding.Lower values include more subtle content; higher values are stricter.
Background color for contrast detection on opaque logos. Can be a CSS color string or RGB array.This also enables irradiation compensation: light content on dark backgrounds appears larger due to the Helmholtz irradiation illusion. Logo Soup automatically scales down light-on-dark logos proportionally to darkness × density.
Auto-detected by default. Only set this if you know your logos have a specific opaque background color that differs from the perimeter analysis.
React Component Props
The React<LogoSoup> component accepts all core options above, plus these additional props:
Space between logos. Can be a number (pixels) or a CSS value.
Alignment mode for visual centering. See Alignment Modes below.
Custom image renderer. Use this to integrate with Next.js Image or add custom attributes.The
props object includes:src: Logo URL (cropped ifcropToContent={true})alt: Alt textwidth: Normalized widthheight: Normalized heightstyle: Transform for visual centering
CSS class name for the container element.
Inline styles for the container element.
Callback invoked when normalization completes.
Alignment Modes
When building custom layouts with theuseLogoSoup hook or other framework adapters, use getVisualCenterTransform(logo, mode) to apply visual centering:
| Mode | Description |
|---|---|
"bounds" | Align by geometric center (bounding box). No transform applied. |
"visual-center" | Align by visual weight center on both axes. |
"visual-center-x" | Visual center horizontally only. |
"visual-center-y" | Visual center vertically only (default). |
Why visual centering matters
Why visual centering matters
Geometric centering uses the bounding box center, but logos often have visual weight off-center due to shape, whitespace, or design details. Visual centering computes the center of mass based on pixel density and contrast, creating better optical alignment.For horizontal logo strips,
"visual-center-y" is usually sufficient (align vertically, let width vary). For grids or vertical layouts, "visual-center" provides the best results.Example: Full Configuration
Performance Notes
- Image loading: All logos load in parallel using
Promise.all. Processing begins once all images have loaded. - Canvas rendering: Content detection uses a downscaled canvas (max 2048 pixels) for fast analysis. Original images are never mutated.
- Caching: The engine caches measurements per logo URL. If you call
process()again with the same URLs, measurements are reused. - Cleanup: Framework adapters automatically call
engine.destroy()on unmount to release blob URLs and prevent memory leaks.