Spatial Photos

August 2026 — October 2026 Personal project
  • Python
  • C++
  • PyTorch
  • WebGL
  • Compression
  • Gaussian splatting

Spatial Photos turns a single image into an interactive 3D photo. It starts with Apple's ML-SHARP model, which predicts a 3D Gaussian splat from the image. I wrote a pipeline that converts the splat into depth-layered mesh geometry and packed texture atlases, then designed a compact .spatial format to ship the result on the web. The viewer uses ordinary WebGL rasterization, avoiding the per-frame sorting of a splat renderer. I published it as an npm web component with mouse and touch parallax. The portrait on this site's homepage uses it. This project was conceived while I was working at True3D, but it was finished on my own time.

Highlights

  • Custom binary format with sparse block masks, shared depth-grid corners, and JPEG-compressed color and alpha atlases.
  • Multithreaded C++ Gaussian rasterizer for generating depth layers on CPU.
  • WebGL viewer shipped as spatial-photos on npm, with pointer-driven parallax, configurable framing, and automatic GPU resource cleanup.

Media

A single JPEG converted into an interactive spatial photo.
A preview of the Spatial Photos homepage, showcasing different images converted to spatial photos.
A Spatial Photo shown from above, showcasing how the mesh is structured
The different layers within a Spatial Photo mesh.