Geometrize is a small Python web app that recreates images as geometric
primitives. The UI, CLI, and packaging are Python-first; the fitting algorithm
still runs in the native C++ core from lib/geometrize.
git submodule update --init --recursive
py -3 -m venv .venv
.\.venv\Scripts\python.exe -m pip install -e ".[dev]"
.\.venv\Scripts\python.exe -m geometrize_py serve --host 127.0.0.1 --port 7860Open http://127.0.0.1:7860, choose an image, tune the shape settings, and add
a batch of primitives. The UI draws accepted shapes into a live preview, can
pause or continue the same evolving result with different shape settings, charts
the convergence and score impact, and exports PNG, SVG, and JSON shape data.
.\.venv\Scripts\python.exe -m geometrize_py run C:\LocalRepos\geometrize\screenshots\logo.png `
--output C:\LocalRepos\geometrize\build\logo.png `
--svg C:\LocalRepos\geometrize\build\logo.svg `
--json C:\LocalRepos\geometrize\build\logo.json `
--steps 128 --shape-types ellipse,rotated_rectangle,triangle `
--longest-dimension 2048Use .\.venv\Scripts\python.exe -m geometrize_py doctor to confirm that the
native backend can be imported.
python/geometrize_py/contains the Python package, web server, static UI, image helpers, SVG exporter, CLI, and native backend wrapper.python/geometrize_py/native_bindings.cppis the pybind11 bridge into the C++ core.lib/geometrize/is the upstream core engine submodule.tests/python/covers the native wrapper, SVG export, and HTTP API.screenshots/keeps example inputs and historical output samples.
Run the tests with:
.\.venv\Scripts\python.exe -m pytestThe extension is built by scikit-build-core and CMake when installing the package. A working C++17 compiler is required for a fresh native build, but no desktop UI toolchain is needed.
