lumina-svg-core
English · 简体中文 · Installation · Quick start · API reference · SVG support
A native C++17 and Python 2D SVG geometry engine for print workflows.
lumina-svg-core resolves SVG paint operations, converts fills and strokes into planar polygons, and exposes read-only NumPy arrays to Python while preserving paint order, holes, clipping, solid-color alpha compositing, and paint provenance.
Originally built for Lumina Studio, lumina-svg-core lives in this independent repository with its C++ geometry kernel, pybind11 bindings, test suite, and wheel build tooling.
Current release: 0.3.4 (alpha) · Python: CPython 3.12, 3.13, 3.14
Installation
Prebuilt wheels
python -m pip install lumina-svg-core==0.3.4
Prebuilt wheels bundle pinned LunaSVG/PlutoVG and Clipper2 sources (also downloadable from GitHub Releases):
| Platform | Architecture | Baseline |
|---|---|---|
| Windows | x86-64 | 64-bit CPython 3.12–3.14 |
| macOS | Apple Silicon (arm64) & Intel (x86_64) |
macOS 12+ (Python 3.12/3.13), macOS 14+ (Python 3.14) |
| Linux | x86-64 | manylinux_2_28 (glibc 2.28+) |
Build from source
Requires CPython 3.12–3.14, Git, network access (for pinned LunaSVG and Clipper2 revisions on first build), and a C++17 compiler (MSVC, Apple Clang, or GCC/Clang):
git clone https://github.com/lumina-layer-studio/lumina-svg-core.git
cd lumina-svg-core
python3.12 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install .
On Windows PowerShell, run py -3.12 -m venv .venv and .venv\Scripts\Activate.ps1 from a Visual Studio Developer PowerShell.
Quick start
import lumina_svg_core
svg = """<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 10">
<rect width="20" height="10" fill="#e63946"/>
<circle cx="10" cy="5" r="3" fill="#457b9d" fill-opacity="0.5"/>
</svg>"""
result = lumina_svg_core.analyze_svg_svg(
svg,
target_width_mm=40.0,
tolerance_mm=0.02,
)
if result.status != "supported":
raise RuntimeError(f"SVG analysis failed: {result.status}: {result.reason_code}")
print(result.visible.geometry_count)
print(result.visible.rgba_f64)
# Convert integer working-grid coordinates to millimetres:
coordinates_mm = (
result.visible.coordinates.astype("float64")
* result.grid_to_source_unit
* result.scale_factor
)
- Analyze a file:
lumina_svg_core.analyze_svg("drawing.svg", target_width_mm=40.0, tolerance_mm=0.02)(strorpathlib.Path). - Fills only: Pass
allow_strokes=Falseto skip strokes while keeping filled regions. - Output views:
result.rawholds painted polygons before occlusion,result.visibleholds non-overlapping visible regions, andresult.silhouetteholds the outer footprint.
Ring traversal, status codes, build provenance (__version__, __source_revision__, __source_dirty__), and lower-level APIs are documented in docs/api.md and docs/DISTRIBUTIONS.md.
Supported SVG features
| Category | Supported features |
|---|---|
| Solid fills and strokes | Fill rules (nonzero, evenodd), line caps, line joins, dash arrays, and non-scaling-stroke |
| Shapes and paths | <rect>, <circle>, <ellipse>, <polygon>, <polyline>, <line>, and <path> curves/arcs |
| Layout | Affine transform, viewBox origins, nested <svg> viewports, and percentage lengths |
| References and styles | Supported CSS selectors and same-document <use> elements |
| Clipping and markers | <clipPath>, marker paints, and viewport clipping |
| Transparency | Solid-paint alpha and object/group opacity composited in premultiplied sRGB |
Documents using features outside this 2D solid-paint subset return status == "unsupported" with a specific reason_code; see docs/support.md for supported boundaries and numerical limits.
Development and validation
python -m pip install ".[test]" build
python -m pytest tests -q
python -m build
python tools/verify_wheel.py dist/<wheel-filename>.whl --contents-only
See CONTRIBUTING.md and benchmarks/README.md.
License and acknowledgements
Licensed under AGPL-3.0-only; see LICENSE.
Third-party attributions and license texts for LunaSVG, PlutoVG, Clipper2, pybind11, and ChromaPrint3D are in THIRD_PARTY_NOTICES.md and THIRD_PARTY_LICENSES/. Report bugs via GitHub Issues and security issues per SECURITY.md.
Metadata
Release files for lumina-svg-core 0.3.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lumina_svg_core-0.3.5.tar.gz | 2.0 MB | With provenance | Details for lumina_svg_core-0.3.5.tar.gz |
Built distributions (wheels)
Total release size: 12.8 MB
Release files / lumina_svg_core-0.3.5.tar.gz
| Download URL | lumina_svg_core-0.3.5.tar.gz |
|---|---|
| Size | 2.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
858d736a8a1f234d78ac3a0953088c184f6afd360834bbbddb3662deb5558987
|
|
BLAKE2b-256 checksum How to use checksums |
a50e89a54b8fa3581336915d38266f7fbb6a49ec754331adfed7d3d9642afea9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logRelease files / lumina_svg_core-0.3.5-cp314-cp314-win_amd64.whl
| Download URL | lumina_svg_core-0.3.5-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 990.6 kB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
c156891918229615b872b86f950c604e0bf7c627cd6a1bca146f3f53e9be6aef
|
|
BLAKE2b-256 checksum How to use checksums |
3319d4731d61dc30f24c1298a4f8b19b02d47b93ff4d48cc916c824ff01279b2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logRelease files / lumina_svg_core-0.3.5-cp314-cp314-manylinux_2_28_x86_64.whl
| Download URL | lumina_svg_core-0.3.5-cp314-cp314-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.14 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
31227182ef0217d3112bc432b087921d238200c7b385ae422ca5871b12ccf492
|
|
BLAKE2b-256 checksum How to use checksums |
49b606997647ab3af45c0ba267a5a6d53038e12a403faa2dd49833db001856a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logRelease files / lumina_svg_core-0.3.5-cp314-cp314-macosx_14_0_x86_64.whl
| Download URL | lumina_svg_core-0.3.5-cp314-cp314-macosx_14_0_x86_64.whl |
|---|---|
| Size | 809.0 kB |
| Tags | CPython 3.14 macOS 14.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
baae72cb85c7f78b03ec6f259d6a0ff2ffb84981307de7e9a30536a8d53c4a3c
|
|
BLAKE2b-256 checksum How to use checksums |
072d20d37ef44e08430109e53cfbfdbc0b1605d238e8946b3140877badabf207
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logRelease files / lumina_svg_core-0.3.5-cp314-cp314-macosx_14_0_arm64.whl
| Download URL | lumina_svg_core-0.3.5-cp314-cp314-macosx_14_0_arm64.whl |
|---|---|
| Size | 727.5 kB |
| Tags | CPython 3.14 macOS 14.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
c3480df65e65e39dbfcbbf4caad2876954d667f0eecc00b2cda39100ce6eed40
|
|
BLAKE2b-256 checksum How to use checksums |
38282a1704424ff053e9bcc420f3bdebed72cc28cd16f12549fc99e54d299abe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logRelease files / lumina_svg_core-0.3.5-cp313-cp313-win_amd64.whl
| Download URL | lumina_svg_core-0.3.5-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 960.5 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
3c26a75d7c15cbf3a46d3db46d11c49418f7c71c04f23f2befbb2d0dcd6e8745
|
|
BLAKE2b-256 checksum How to use checksums |
3606f1141ae96fb95a23cf2e3d5e533046e22c5efaedd97d77ab20f524948f49
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logRelease files / lumina_svg_core-0.3.5-cp313-cp313-manylinux_2_28_x86_64.whl
| Download URL | lumina_svg_core-0.3.5-cp313-cp313-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.13 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
151d44de58f51d5dada5da47dbed126808b9c147163e4c1b2dce3acd51cb913d
|
|
BLAKE2b-256 checksum How to use checksums |
4f295410859473d5cba23167b984bef59138dca1d1bacaad20f4fbcb1c048761
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logRelease files / lumina_svg_core-0.3.5-cp313-cp313-macosx_12_0_x86_64.whl
| Download URL | lumina_svg_core-0.3.5-cp313-cp313-macosx_12_0_x86_64.whl |
|---|---|
| Size | 812.5 kB |
| Tags | CPython 3.13 macOS 12.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
58b4899b5e88387e0f0b5cbca0fbf9d80e4fe1bf74e3bfe5ce2dfe2eb36d033b
|
|
BLAKE2b-256 checksum How to use checksums |
8d1a2ae20065454b91b5c9bd535ed5910d5450f30ef977d162acef9b38c8f656
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logRelease files / lumina_svg_core-0.3.5-cp313-cp313-macosx_12_0_arm64.whl
| Download URL | lumina_svg_core-0.3.5-cp313-cp313-macosx_12_0_arm64.whl |
|---|---|
| Size | 730.5 kB |
| Tags | CPython 3.13 macOS 12.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
58ba7e44b9d875d4a85aeee564341a472daab705d0d56c39645bd8096dd665b7
|
|
BLAKE2b-256 checksum How to use checksums |
5ac79a962d79ecb1ff302ec66ae00489c13e00912f1933c65373dd94329913f8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logRelease files / lumina_svg_core-0.3.5-cp312-cp312-win_amd64.whl
| Download URL | lumina_svg_core-0.3.5-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 960.5 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
aa6b56472f7d9fb1f24a712a0fc3e59e045b9751879b6dbe06aed4c1395a4ad5
|
|
BLAKE2b-256 checksum How to use checksums |
a636bf84a1b5b447e26aaeacf8254fadae7efaba087aa24f80541a3410da41b6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logRelease files / lumina_svg_core-0.3.5-cp312-cp312-manylinux_2_28_x86_64.whl
| Download URL | lumina_svg_core-0.3.5-cp312-cp312-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.12 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
4b02437a0dc58d232e34ed74dc81027add40bbb1da24c7902baeb759fd55c179
|
|
BLAKE2b-256 checksum How to use checksums |
2a4586e6486580bd6cf50b9246f493b5839792f9f0de11260206b4dfec9b57f2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logRelease files / lumina_svg_core-0.3.5-cp312-cp312-macosx_12_0_x86_64.whl
| Download URL | lumina_svg_core-0.3.5-cp312-cp312-macosx_12_0_x86_64.whl |
|---|---|
| Size | 812.4 kB |
| Tags | CPython 3.12 macOS 12.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
3f3f9699f3766e031a6cc3fa05195bb6e7327e43c4c688972eb436de01fc42bf
|
|
BLAKE2b-256 checksum How to use checksums |
9bd82aa7211d8124f78d3e308b22de0124a14e2a84ea110172c1cae5ed25337e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logRelease files / lumina_svg_core-0.3.5-cp312-cp312-macosx_12_0_arm64.whl
| Download URL | lumina_svg_core-0.3.5-cp312-cp312-macosx_12_0_arm64.whl |
|---|---|
| Size | 730.3 kB |
| Tags | CPython 3.12 macOS 12.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
3adbf2b87a57130498e2971b48ced19f00d018da71903e08674d3ca4b5fc7816
|
|
BLAKE2b-256 checksum How to use checksums |
5c288cc72c127c838b207713de4b575d9ac149d07cbbeb1a8152b15366193f66
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logSecurity for lumina-svg-core 0.3.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 13 files in this release have been uploaded with provenance metadata.
Attestation for lumina_svg_core-0.3.5.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.