Gaussian Splatting From Zero · Episode 12

Compression & Formats

Compression & Formats is Episode 12 of Gaussian Splatting From Zero, a MasterAllArts free interactive lesson for artists learning creative 3D on the web.

Part of the MasterAllArts Creative 3D Roadmap .

← Gaussian Splatting From ZeroEpisode 12 · Season 2
Episode 12 · Gaussian Splatting From Zero · Season 2

A clean capture is still huge. A million-splat scene at full spherical-harmonic precision is a quarter-gigabyte .ply — nobody's loading that on a phone. Compression is what makes splats shippable, and it's almost all quantization: store each number in fewer bits. The art is spending your bits where the eye notices. Drag the precision slider and watch the file size collapse — and, eventually, the planet fall apart.

—
drag to orbit · scroll to zoom
16-bit · —
Full precision. Drag bits down and watch size drop and banding appear.

Why a raw splat file is so big

Recall the per-splat budget from Season 1, at full 32-bit float, degree-3 SH:

FieldFloatsBytes (f32)
position312
scale + rotation3 + 428
opacity14
SH color (deg 3)48192
total59≈ 236 B / splat

At a million splats that's ~236 MB. Notice color (the SH) is 80% of it — which is why every compressor attacks the SH first.

The four levers

  1. Quantize. Store positions/scales/colors/SH in 8–16 bits instead of 32. The single biggest win. This is what the slider does.
  2. Truncate SH. Drop degree 3→1, or to flat color, on mobile. Kills most of the bytes for a little view-dependence.
  3. Prune. Delete near-transparent and sub-pixel splats (Episode 11). Fewer splats, fewer bytes.
  4. Entropy-code. Gzip/brotli the quantized stream; sort splats spatially first so neighbors compress well.

Quantization, in one line

Quantizing a value to B bits over a known range is just snapping it to one of 2ᴮ evenly-spaced levels:

function quantize(v, lo, hi, bits) {
  const levels = (1 << bits) - 1;          // e.g. 8 bits → 255
  const t = Math.round((v - lo) / (hi - lo) * levels);
  return lo + (t / levels) * (hi - lo); // snapped back to a real value
}

Fewer bits = fewer levels = visible banding in color and a jitter /facet in geometry as positions snap to a coarse grid. The slider applies this live; the "quantize" menu lets you isolate position vs color so you can see which artifact is which.

Watch the order things break. Color bands first and worst — your eye is exquisitely sensitive to smooth gradients. Position survives surprisingly low bit-depths because splats overlap and hide each other's snapping. That asymmetry is exactly why real formats give position ~11–16 bits and SH as few as 4–8.

The format zoo

FormatWhat it isRough size vs raw PLY
.plyLossless float master, all SH. The archival original.1× (baseline)
.splatantimatter15's 32-byte/splat: f32 pos+scale, 8-bit color, 8-bit quat, no higher SH.~0.15×
.ksplatmkkellogg's compressed format with quality levels and optional SH.~0.1–0.3×
.spzNiantic's open, Gaussian-aware quantized format. Becoming the web default.~0.1× (≈10× smaller)
glTF KHR_gaussian_splattingDraft extension to put splats in the standard 3D asset pipeline.varies

They differ in bit-packing and metadata, not in concept — every one decodes to the same five attributes your Episode 07 loader already reads. Pick by ecosystem: .splat for dead-simple, .spz for smallest-and-open, .ksplat for quality knobs, glTF for pipeline integration.

Common pitfalls

  • Quantizing position in world space with a huge bbox. A few outlier splats blow up the range and waste all your levels. Crop first (Episode 11), or quantize per-chunk.
  • Banding in smooth areas. Too few color/SH bits. Give color more bits than geometry; the eye votes for color.
  • "Compressed" but still slow to load. You quantized but didn't entropy-code. Gzip/brotli the quantized buffer; spatially sort first so it compresses.
  • Shipping degree-3 SH to phones. That's 80% of the file for an effect most users never orbit enough to see. Truncate to degree 1 or 0 on mobile.

Exercises

  1. Find the lowest bit-depth where the planet still looks "fine" at arm's length. That's your shipping precision — and it's lower than you'd guess.
  2. Quantize position-only vs color-only at the same bits. Which artifact is uglier? Now you know where to spend bits.
  3. Convert a real .ply to .spz (Niantic's tool) and to .splat; compare sizes and load times against the original.

What's next

Episode 13 — Splats in a Real Scene. Compression got the file small; now we put it to work — a capture walked through like a level, with solid mesh props, occlusion, and fake contact shadows, so the splats feel like a place instead of a decal.