Metadata-Version: 2.4
Name: sogpy
Version: 1.0.0
Summary: Convert Gaussian Splat PLY files to PlayCanvas SOG format
Author: Sai Kiran Nunemunthala
License: MIT
Project-URL: Homepage, https://github.com/saikirannunemunthala/sogpy
Project-URL: Repository, https://github.com/saikirannunemunthala/sogpy
Project-URL: Issues, https://github.com/saikirannunemunthala/sogpy/issues
Keywords: gaussian-splatting,3d,playcanvas,sog,ply,webp,compression
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Multimedia :: Graphics :: 3D Modeling
Classifier: Topic :: Scientific/Engineering :: Image Processing
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.20.0
Requires-Dist: scipy>=1.7.0
Requires-Dist: Pillow>=9.0.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Dynamic: license-file

# SogPy

Convert Gaussian Splat `.ply` files to PlayCanvas `.sog` format.

## Installation

```bash
pip install sogpy
```

## Usage

### Command Line

```bash
# Basic conversion
sogpy input.ply output.sog

# With more clustering iterations (better quality, slower)
sogpy input.ply output.sog --iterations 20
```

### Python API

```python
from SogPython import convert_ply_to_sog

convert_ply_to_sog("input.ply", "output.sog")
```

## What is SOG?

SOG (Splat Optimized Graphics) is PlayCanvas's format for Gaussian splat data. It uses:

- **WebP lossless compression** for textures
- **K-means clustering** to reduce color and scale data to 256 values
- **Morton ordering** for spatial coherence
- **Smallest-three quaternion encoding** for rotations

This typically achieves **5-6x compression** compared to raw PLY files while preserving all data including spherical harmonics.

## Features

- ✅ Full PLY format support (binary little-endian)
- ✅ Spherical harmonics (bands 1-3)
- ✅ WebP lossless compression
- ✅ 16-bit position precision with log transform
- ✅ Smallest-three quaternion compression

## Requirements

- Python 3.8+
- numpy
- scipy
- Pillow

## License

MIT
