Introduction
SPZ is a compressed format for Gaussian splat scenes from Niantic, published as open source in 2024. Niantic’s Scaniverse app saves scenes in it. It stores the same splats as the 3D Gaussian Splatting PLY in roughly a tenth of the space: each value is quantised to a few bits, the values are grouped attribute by attribute so that like is next to like, and the result is compressed.
Versions 1 to 3 compress everything with gzip. Version 4 keeps a small header in the clear and compresses each attribute with Zstandard on its own, so that they can be decompressed in parallel.
Structure
A file of versions 1 to 3 is a gzip file. Decompressed, it is a 16-byte header, then each attribute for all the splats in turn.
0HeaderNGSP, version, number of splats, harmonics degree, fractional bits, flags16 bytes16Positions x, y, z: 24-bit fixed point (half floats in version 1)9 bytes a splat…Alphas opacity1 byte a splat…Colours red, green, blue3 bytes a splat…Scales log scale on each axis3 bytes a splat…Rotations quaternion: x, y, z, or smallest three from version 33 or 4 bytes a splat…Spherical harmonics a byte a coefficient, when the degree is 1 or more9, 24, 45 or 72 bytes a splat
A version 4 file starts with the bytes NGSP itself, not with gzip’s
1F 8B: a 32-byte header, optional extension records, a table of contents
and one Zstandard stream for each attribute. The file explorer decompresses
the streams, checks them against the counts and the table of contents, and draws the
scene, for every version; for a gzip file it also offers the decompressed data as a
file of its own.
In this reference
- Header and attributes – the 16-byte header and every attribute byte by byte, for versions 1 to 3, how each becomes part of a Gaussian, a worked example, version 4’s header, table of contents and streams, and the extension records and frames
Not described
The pages follow Niantic’s library (load-spz.cc, the README and the
extensions README) and were checked against its two sample files (18 MB and 24 MB,
version 2 or 3) and splat-transform’s test files of versions 2 to 4. The explorer
labels what it does not decode.
Known, not yet covered
- Viewer: the values of a custom attribute (its extension frames are found, checked against the record and decompressed for the check, but the values are not decoded into numbers or shown), and the georeference and safe-orbit records, which are listed field by field but not applied to the pictures.
- Viewer: files stored in a coordinate system other than RUB (the coordinate system extension). Standard-family systems with y down are drawn upright; the rotated systems 9 to 16 are drawn as stored, on their side.
- Viewer: degree 4 harmonics are decoded and listed but not part of the pictures, which use up to degree 3.
- Reference: the Wigner matrices the library uses to turn
harmonics coefficients when converting between coordinate systems, and the
SPZ_NIANTIC_*andSPZ_ADOBE_*PLY element names. - Viewer: no real version 4 file was found except splat-transform’s 4-splat test file; version 4 with several streams and extension frames is checked on built files and the library’s code.
Unknown
- Reference and viewer: extensions of other vendors. A record of a type the extensions README does not list is shown with its type, length and bytes.
Links
Software
- Scaniverse – Niantic’s 3D scanning app, which saves splat scenes as .spz (iOS, Android)
- SuperSplat – PlayCanvas’s free open source splat editor (web)
Developers
- spz – Niantic’s library that reads and writes the format and converts from PLY (C++)
- splat-transform – converts between splat formats, .spz among them (JavaScript)
Reference
- spz README – Niantic’s description of the format and its versions