Raise master_max and piece counts, cache tile prep, and scale mittel/dicht from the validated wenig density ladder so each profile can fill the canvas. Co-authored-by: Cursor <cursoragent@cursor.com>
1.4 KiB
1.4 KiB
DESIGN — Fractal mosaic Python engine (Tower)
Goal
Headless RST collage generator for the Tower mosaik inbox, adapted from Seth Benton’s Fractal-Mosaics (GPL).
Pipeline
- Load tile pool; cache mean RGB + HSV histogram (CBIR prefilter).
- Resize master to profile
master_max. - For each tile size (largest first), scan uncovered centers.
- Rank tiles by histogram/mean distance (selection only — no recolor).
- Estimate rotation/scale via log-polar phase correlation; snap to discrete rot/scale candidates.
- Place with edge alpha blend if RMS and overlap pass thresholds.
- Write PNG.
Profiles
See src/fractal_mosaic/profiles.py: wenig, mittel, dicht.
Coverage
Profiles target ~99% canvas coverage via denser RST passes + residual fill, while keeping Fractal RST (rotation / scale / translate) — not a classic grid mosaic. Pool images may be reused heavily when the library is small.
Tile size (readability)
Piece sizes stay in a recognizable absolute range while master_max is high so
the canvas holds many pieces. Relative density ladder (largest tile / master):
wenig ≈1.75%, mittel ≈1.3%, dicht ≈1.0%. max_placements scales with
(master_max / mean_tile)^2 so each profile can still hit ~99% coverage.
Scales never enlarge above 1.0.
Non-goals (v1)
- Faithful bit-identical MATLAB port
- Color transfer / hue variants
- GPU acceleration