Skip to main content

lumina-svg-core

Build wheels Python 3.12–3.14 License: AGPL v3

English | 简体中文

A native SVG geometry engine for print workflows. lumina-svg-core resolves SVG paint operations, converts them into polygons, and exposes the result to Python as read-only NumPy arrays. It preserves paint order, holes, clipping, solid-color alpha compositing, and the identity of contributing paints.

Originally developed for Lumina Studio, this independent repository contains the geometry engine, Python bindings, test fixtures, and build tools. It has no runtime dependency on Lumina Studio, its UI, printer settings, or application services. It does not generate meshes or 3MF files.

Status: version 0.3.3 (alpha). CPython 3.12, 3.13 and 3.14 are supported. The geometry result contract is schema version 4.

Installation

Prebuilt wheels

Install the current public release from PyPI:

python -m pip install lumina-svg-core==0.3.3

See the PyPI version page and publishing workflow for the released files and their build/installation checks.

No C++ compiler, third-party checkout, manual patch, or local wheelhouse is needed for a matching prebuilt wheel. LunaSVG/PlutoVG and Clipper2 are compiled into the extension by maintainers.

Alternatively, download a matching wheel from GitHub Releases and install the downloaded file:

python -m pip install /path/to/lumina_svg_core-0.3.3-cp314-cp314-platform.whl

Replace the example filename with the actual downloaded wheel. Wheels are built for Windows x86-64, macOS Apple Silicon, macOS Intel, and Linux x86-64. macOS requires version 12 or newer for Python 3.12/3.13, and version 14 or newer for Python 3.14. Linux wheels use manylinux_2_28 and require glibc 2.28 or newer; Alpine/musl, Windows ARM and free-threaded Python are not covered. Match the wheel's OS, CPU and Python tags.

Build the native library from source (contributors)

You need CPython 3.12–3.14, Git, and a C++17 compiler: MSVC on Windows, Apple Clang on macOS, or GCC/Clang on Linux. The build installs its pinned Python build tools and fetches pinned LunaSVG and Clipper2 source revisions, so network access is required for a fresh build.

This is the library contributor workflow, not a prerequisite for running Lumina Studio from its Python/TypeScript source.

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, use py -3.12 -m venv .venv and activate it with .venv\Scripts\Activate.ps1 in PowerShell. Run the build from a Visual Studio developer shell if MSVC is not already available on your command line.

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)

# Coordinates are an integer working grid, not SVG units or millimetres.
coordinates_mm = (
    result.visible.coordinates.astype("float64")
    * result.grid_to_source_unit
    * result.scale_factor
)

To read a file, use lumina_svg_core.analyze_svg("drawing.svg", target_width_mm=40.0, tolerance_mm=0.02). Paths may also be pathlib.Path instances. Both analysis entry points accept allow_strokes=False to omit stroke paints while retaining fills.

Inspect the installed build with lumina_svg_core.__version__, lumina_svg_core.__source_revision__ and lumina_svg_core.__source_dirty__. Git-free source builds report unknown provenance unless the builder supplies it explicitly. Distribution preparation describes the build identity and checked file receipts.

See the API reference for ring traversal, result statuses, source identity, coordinate units, and the lower-level recording and grid APIs.

SVG support

Supported Details
Solid fills and strokes Fill rules, caps, joins, supported dash arrays, and non-scaling strokes
Shapes and paths Rectangles, rounded rectangles, circles, ellipses, polygons, and SVG path curves/arcs
Layout Affine transforms, viewBox origins, nested SVG viewports, and percentage lengths
References and styles Supported CSS selectors and same-document <use> references
Clipping and markers Vector clips, marker paints, and viewport clipping
Transparency Solid-paint alpha and isolated object/group opacity with normal source-over compositing

The SVG root begins transparent. The engine introduces no white background or printer-material matte. Fully opaque documents use reverse-order occlusion; translucent documents are partitioned and composited in premultiplied sRGB.

Masks, gradients, patterns, text, embedded images, external resources, non-normal blend modes, non-sRGB interpolation, and other unsupported semantics return a whole-document unsupported result. Zero-length dash entries are also unsupported. See support and numerical limits.

The recorder refactor reduces upstream patch additions by 46.5% while preserving the public API and geometry schema. Its prior comparison of 508 private SVGs at 220 mm / 0.02 mm with strokes enabled found the same 504 supported results and four native_geometry_error failures in both builds, with zero output differences. Those failures were not counted as passes. Version 0.3.3 addresses the canonical-boundary arithmetic and incomplete noding mechanisms, without adding printer policy or a fallback; see the fix and validation scope.

Geometry contract

  • raw contains area-bearing paint geometry before paint-order occlusion; visible contains the final non-overlapping painted regions; silhouette contains their combined footprint.
  • Coordinates use an integer working grid with an explicit conversion factor. Arrays preserve polygon components, holes, colors, and paint provenance.
  • rgba_f64 is authoritative straight-sRGB RGBA in [0, 1]; rgba is a compatibility byte representation.
  • Point-only, line-only, empty, and collapsed fragments are reported separately in unprintable_fragments. They are not fabricated into printable polygons.
  • Unsupported or invalid documents are rejected as a whole. The standalone package does not retry them through another parser or silently discard unsupported elements.
  • The parser performs no morphological closing, printer-grid snapping, minimum-area filtering, triangulation, or mesh repair.

Independent normalization work can run in parallel. Set LUMINA_SVG_REPLAY_THREADS to a positive integer to select a worker count; the engine caps it at 16. Parallel and serial replay preserve the same ordered geometry and provenance.

Development and validation

python -m pip install ".[test]" build
python -m pytest tests -q
python -m build
python tools/verify_wheel.py dist/<actual-wheel-filename>.whl --contents-only

CI builds and installs wheels for all three Python versions on all four platform targets, runs the complete Python suite, checks binary/license contents, and exercises installed extensions. A separate Linux job builds a wheel from the source distribution and runs the native canonical-boundary regression. See CONTRIBUTING.md for the development workflow and benchmarks/README.md for reproducible measurements.

Performance numbers depend on the input, compiler, CPU, and thread count. The checked-in benchmark report describes its reference host; it is not a universal latency guarantee.

License and acknowledgements

The project is licensed under the GNU Affero General Public License, version 3 only (AGPL-3.0-only). See LICENSE for the full terms.

The implementation uses pinned LunaSVG/PlutoVG and Clipper2 sources, pybind11 bindings, and adapted hole-selection criteria from ChromaPrint3D. Their licenses and attributions remain separate and are documented in THIRD_PARTY_NOTICES.md and THIRD_PARTY_LICENSES/.

Report reproducible problems through GitHub Issues. For sensitive reports, follow SECURITY.md.

Metadata

Release files for lumina-svg-core 0.3.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lumina-svg-core 0.3.3
File Size Uploaded
lumina_svg_core-0.3.3.tar.gz 2.0 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for lumina-svg-core 0.3.3
File
lumina_svg_core-0.3.3-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details
lumina_svg_core-0.3.3-cp314-cp314-manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ x86-64 Details
lumina_svg_core-0.3.3-cp314-cp314-macosx_14_0_x86_64.whl CPython 3.14 CPython 3.14 macOS 14.0+ x86-64 Details
lumina_svg_core-0.3.3-cp314-cp314-macosx_14_0_arm64.whl CPython 3.14 CPython 3.14 macOS 14.0+ ARM64 Details
lumina_svg_core-0.3.3-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
lumina_svg_core-0.3.3-cp313-cp313-manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64 Details
lumina_svg_core-0.3.3-cp313-cp313-macosx_12_0_x86_64.whl CPython 3.13 CPython 3.13 macOS 12.0+ x86-64 Details
lumina_svg_core-0.3.3-cp313-cp313-macosx_12_0_arm64.whl CPython 3.13 CPython 3.13 macOS 12.0+ ARM64 Details
lumina_svg_core-0.3.3-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
lumina_svg_core-0.3.3-cp312-cp312-manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64 Details
lumina_svg_core-0.3.3-cp312-cp312-macosx_12_0_x86_64.whl CPython 3.12 CPython 3.12 macOS 12.0+ x86-64 Details
lumina_svg_core-0.3.3-cp312-cp312-macosx_12_0_arm64.whl CPython 3.12 CPython 3.12 macOS 12.0+ ARM64 Details

Total release size: 12.7 MB

Release files / lumina_svg_core-0.3.3.tar.gz

Download URL lumina_svg_core-0.3.3.tar.gz
Size 2.0 MB
Tags Source
SHA-256 checksum
How to use checksums
eb3233da61269a6f425dd5e7faefcee0636bde8dd4627d700c12b71017362308
BLAKE2b-256 checksum
How to use checksums
fa8247d12cfa2239a67d84fc660c21c8c57b4e99fde87e89c5b1d0ae9edee7b4
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 Oct 16, 2026.

Transparency log

Release files / lumina_svg_core-0.3.3-cp314-cp314-win_amd64.whl

Download URL lumina_svg_core-0.3.3-cp314-cp314-win_amd64.whl
Size 986.8 kB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
052b9031f4ff514ef9b2e3d5d8c69556488bebb43b8108d08af7822a6ac3f38a
BLAKE2b-256 checksum
How to use checksums
50415a1a679e64aef69ed1145d24133474c7d862e58d18f4fec299c14ad39d3f
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 Oct 16, 2026.

Transparency log

Release files / lumina_svg_core-0.3.3-cp314-cp314-manylinux_2_28_x86_64.whl

Download URL lumina_svg_core-0.3.3-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
052d0af75416929865a85a3fd597e7c906837c73b8b8fbd5df66655f6f3f5d1b
BLAKE2b-256 checksum
How to use checksums
06200537d2e0af667502d3a20fe938c050335471014002b9574c36f5b8009cb4
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 Oct 16, 2026.

Transparency log

Release files / lumina_svg_core-0.3.3-cp314-cp314-macosx_14_0_x86_64.whl

Download URL lumina_svg_core-0.3.3-cp314-cp314-macosx_14_0_x86_64.whl
Size 804.6 kB
Tags CPython 3.14 macOS 14.0+ x86-64
SHA-256 checksum
How to use checksums
d15fb25727c3336f7bd32504517a13c055aceea9aeaf2290b2b3396c6e9fe4ba
BLAKE2b-256 checksum
How to use checksums
f0005110a5cc6b993f004b712070456aa08e1b6ec2c70aa0f80a6b156ba1c14f
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 Oct 16, 2026.

Transparency log

Release files / lumina_svg_core-0.3.3-cp314-cp314-macosx_14_0_arm64.whl

Download URL lumina_svg_core-0.3.3-cp314-cp314-macosx_14_0_arm64.whl
Size 723.0 kB
Tags CPython 3.14 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
c25de65af5e3b6ff006f5c3d9b836b10e912e9345bc9002d36a1dd5351bcb142
BLAKE2b-256 checksum
How to use checksums
d31f27009cbc991a54eca4a0273a410f90a0bb2303b7ef36d7b99e658807d495
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 Oct 16, 2026.

Transparency log

Release files / lumina_svg_core-0.3.3-cp313-cp313-win_amd64.whl

Download URL lumina_svg_core-0.3.3-cp313-cp313-win_amd64.whl
Size 956.4 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
79d3f5e672314b9a3dca7cb15bd917726235b6bc13cdb8d9cc650d6487582467
BLAKE2b-256 checksum
How to use checksums
bde920dffb674aa2221ce128bb63bf1710ee7176f2ce97c451285ee30d98a026
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 Oct 16, 2026.

Transparency log

Release files / lumina_svg_core-0.3.3-cp313-cp313-manylinux_2_28_x86_64.whl

Download URL lumina_svg_core-0.3.3-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
e37f6479db7a243bbb515f3823f2e80da1a680f2268c0b3eb448adeeb5cbd79e
BLAKE2b-256 checksum
How to use checksums
35837484f80271f05367214535f105f2f6228fc3b4fa5f5e34f92cb22f4f2fe8
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 Oct 16, 2026.

Transparency log

Release files / lumina_svg_core-0.3.3-cp313-cp313-macosx_12_0_x86_64.whl

Download URL lumina_svg_core-0.3.3-cp313-cp313-macosx_12_0_x86_64.whl
Size 808.2 kB
Tags CPython 3.13 macOS 12.0+ x86-64
SHA-256 checksum
How to use checksums
c03c8ca23f28ea325a15177bd3c9bc3853bd62c6d45ffbf1134132fce3e463c3
BLAKE2b-256 checksum
How to use checksums
1440e60d881df7c2dde323f289dc1c00625fe508b8fe30da92586489f3511b87
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 Oct 16, 2026.

Transparency log

Release files / lumina_svg_core-0.3.3-cp313-cp313-macosx_12_0_arm64.whl

Download URL lumina_svg_core-0.3.3-cp313-cp313-macosx_12_0_arm64.whl
Size 726.5 kB
Tags CPython 3.13 macOS 12.0+ ARM64
SHA-256 checksum
How to use checksums
03cdf3d38f4c2833a09d6072ba0289e8a2ee5e7d94991cc413e2b8a19e0d5e18
BLAKE2b-256 checksum
How to use checksums
4b8481680352d0beb808e9e47c5f491411069c27fd653a8d31529b8af24d99a8
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 Oct 16, 2026.

Transparency log

Release files / lumina_svg_core-0.3.3-cp312-cp312-win_amd64.whl

Download URL lumina_svg_core-0.3.3-cp312-cp312-win_amd64.whl
Size 956.4 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
8b64286e269343538e65c8ec6c7ee1efbf5ca02585265025bca9443d5915d114
BLAKE2b-256 checksum
How to use checksums
add0cb909725805d5fb766f4448fbe8fff943ab0a9d7a9704a137d0cb9ef68ec
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 Oct 16, 2026.

Transparency log

Release files / lumina_svg_core-0.3.3-cp312-cp312-manylinux_2_28_x86_64.whl

Download URL lumina_svg_core-0.3.3-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
7ac0114439850f6aee78b2a1d832de243155b45d6eb9276d2f2684873074b23e
BLAKE2b-256 checksum
How to use checksums
b199cf63c3c04a76110326ad6531afc5d07302d9235917eabe0306cd8afde3a8
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 Oct 16, 2026.

Transparency log

Release files / lumina_svg_core-0.3.3-cp312-cp312-macosx_12_0_x86_64.whl

Download URL lumina_svg_core-0.3.3-cp312-cp312-macosx_12_0_x86_64.whl
Size 808.1 kB
Tags CPython 3.12 macOS 12.0+ x86-64
SHA-256 checksum
How to use checksums
ba3e4e54c7ed84163aeae673ade99658bee314fa90682fb4915024cd55948349
BLAKE2b-256 checksum
How to use checksums
2590dcad9e9515d3662907ae83065c1420cff534f622fd095b0429e0bfeb918d
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 Oct 16, 2026.

Transparency log

Release files / lumina_svg_core-0.3.3-cp312-cp312-macosx_12_0_arm64.whl

Download URL lumina_svg_core-0.3.3-cp312-cp312-macosx_12_0_arm64.whl
Size 726.4 kB
Tags CPython 3.12 macOS 12.0+ ARM64
SHA-256 checksum
How to use checksums
416eb0e4e101e205d93ed52a7e5cf23bea7aeb3f83e7aa6a22543ca22b5a673d
BLAKE2b-256 checksum
How to use checksums
e6230cd179b92d5397463341eaf82fc6294c3b773bba65c766419c3e2e46ad4f
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 Oct 16, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.3 This release

13 release files

0.3.2

13 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page