Metadata-Version: 2.4
Name: splatthis
Version: 0.3.2
Summary: Fit 2D Gaussian splats and export SVG, PPTX, Canvas, CSS, or EML
Author: Bram Alkema
License-Expression: MIT
Project-URL: Homepage, https://github.com/BramAlkema/SplatThis
Project-URL: Repository, https://github.com/BramAlkema/SplatThis
Project-URL: Issues, https://github.com/BramAlkema/SplatThis/issues
Keywords: svg,pptx,canvas,css,email,mlx,steganography,gaussian-splatting
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Multimedia :: Graphics :: Graphics Conversion
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.24
Requires-Dist: Pillow>=9
Requires-Dist: torch>=2
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == "dev"
Requires-Dist: pytest>=8; extra == "dev"
Requires-Dist: ruff>=0.12; extra == "dev"
Requires-Dist: twine>=5; extra == "dev"
Provides-Extra: capture
Requires-Dist: playwright>=1.55; extra == "capture"
Provides-Extra: steg
Requires-Dist: stego-lsb>=1.4; extra == "steg"
Provides-Extra: mlx
Requires-Dist: mlx>=0.15; (platform_machine == "arm64" and sys_platform == "darwin") and extra == "mlx"
Dynamic: license-file

# SplatThis

Turn a PNG or JPEG into a portable scene of editable 2D Gaussian splats.

SplatThis fits one Gaussian population and exports it directly to five formats:

| Format | Artifact |
| --- | --- |
| SVG | Static, script-free vector gradients |
| PPTX | Native editable PowerPoint shapes, without a bitmap fallback |
| Canvas | Self-contained HTML using the Canvas 2D API |
| CSS | Script-free HTML made from CSS gradients |
| EML | An email message with inline CSS and plain-text/Outlook fallbacks |

The default installation is deliberately small: NumPy, Pillow, and Torch.
MLX, browser capture, and low-bit population embedding are opt-in.

## Install

SplatThis requires Python 3.11 or newer.

```bash
pip install splatthis
```

Optional capabilities are installed separately:

```bash
pip install "splatthis[mlx]"      # MLX on Apple Silicon
pip install "splatthis[capture]"  # Playwright client for Chrome/Chromium
pip install "splatthis[steg]"     # low-bit PNG population carrier
```

## Command line

SVG is the default output:

```bash
splatthis input.png -o output.svg
```

Select another target with `--format`:

```bash
splatthis input.png --format pptx   -o output.pptx
splatthis input.png --format canvas -o output-canvas.html
splatthis input.png --format css    -o output-css.html
splatthis input.png --format eml    -o output.eml
```

Control the fit with a small set of explicit options:

```bash
splatthis input.jpg --format pptx \
  --splats 3000 \
  --stages 300,200,100 \
  --max-edge 512 \
  --seed 42 \
  -o output.pptx
```

Use MLX explicitly on an Apple-Silicon Metal session:

```bash
splatthis input.png --optimizer-backend mlx -o output.svg
```

If MLX cannot allocate a Metal device, SplatThis warns and falls back to
Torch before fitting.

## Capture native output

Capture SVG, CSS, or Canvas output with an installed Chrome/Chromium browser:

```bash
splatthis input.png --format css -o output.html --capture capture.png
```

On macOS, PPTX capture uses installed Microsoft PowerPoint through OSA and the
system screenshot utility, with no additional Python package:

```bash
splatthis input.png --format pptx -o output.pptx --capture powerpoint.png
```

macOS may request Automation, Accessibility, and Screen Recording permission.

## Recoverable populations

SVG and PPTX can carry the compressed population that produced them. Preview
PNGs can carry the same envelope in metadata and, with the `steg` extra, in
one or two low bits per channel:

```bash
splatthis input.png -o output.svg --embed-population
splatthis input.png -o output.svg \
  --preview preview.png \
  --embed-population \
  --embed-population-in-pixels
```

Embedded populations are derivatives of the input image. Pixel embedding is
not a security feature, changes pixels slightly, and has finite capacity.

## Python API

```python
from splatthis import SplatConverter

converter = SplatConverter(
    max_splats=2000,
    stages=[200, 150, 100, 50],
    quality_profile="max-fidelity",
    device="cpu",
    seed=42,
)
converter.convert("input.png", "output.pptx", output_format="pptx")
```

The historical `PNG2SVGConverter` name remains available. Direct emitters are
also public for applications that already have a `GaussianSplat` population.

## Project

- [Source and full documentation](https://github.com/BramAlkema/SplatThis)
- [Issue tracker](https://github.com/BramAlkema/SplatThis/issues)
- [Security policy](https://github.com/BramAlkema/SplatThis/blob/main/SECURITY.md)

SplatThis is released under the MIT License.
