Engineering · 3 min read

Why LumaSpace uses so little battery

When we first showed LumaSpace to a friend, his reaction was: "Cool, but my laptop will be dead by lunch." Fair point. Moving video on your desktop sounds like a terrible idea for battery life.

Turns out, it doesn't have to be. The work is in deciding when not to do any.

The trick is not playing video

Most "video wallpaper" apps just play an MP4 behind your windows. That means a full video decoder running constantly, even when you can't see a single pixel of the desktop. We tried that first and got about 90 minutes of battery drain per hour of playback on a MacBook Air. Terrible.

So we rewrote the rendering pipeline. LumaSpace only decodes frames when the desktop is actually visible. The logic is boring, which is the point:

  • A window covers the wallpaper? We pause.
  • You switch to a full-screen app and it's frontmost? We pause.
  • The battery runs low? We pause automatically, without asking you to think about it.

None of this is clever. It's just refusing to decode a frame nobody will ever see. A wallpaper you can't see is, for our purposes, a wallpaper that shouldn't cost you anything.

Let the hardware do the decoding

The other half is staying off the CPU entirely. When we do decode, we hand the work to the Mac's dedicated hardware video decoder rather than grinding through frames in software. That block exists for exactly this kind of job, it's far more power-efficient than the main cores, and it leaves the CPU free for whatever you're actually trying to get done. LumaSpace is native Swift and SwiftUI, built for Apple Silicon first and still happy on Intel Macs, on macOS 14 Sonoma or later.

Encoding matters more than you'd think

We re-encode every clip ourselves before it goes into the library. The originals from our filmmakers are gorgeous 4K masters, sometimes 2GB for a single minute of footage. Nobody wants that sitting on their disk, and nobody's hardware decoder wants to chew through it on a battery.

So the encode does double duty: it keeps files small, and it keeps playback cheap. We tune quality per scene rather than running one preset across everything. A dark, moody cityscape compresses much harder than a bright ocean wave with thousands of moving highlights, so we test each clip individually and pick settings by eye. The curated library is around 60 hand-picked cinematic 4K scenes, and the whole thing stays small enough to keep on disk without you noticing. They still look right on a Retina display, which is the only test that matters.

It scales to more than one screen

If you run more than one display, the same rule applies per screen: a wallpaper you can't see isn't decoding. Each screen gets its own scene at its own resolution, and the engine handles the messy parts — hot-plugging, rearranging, sleep and wake. That side of things has its own story; the short version is that you only pay for the pixels you're actually looking at.

The numbers

On a 2023 MacBook Air M2, with a wallpaper playing and the desktop visible, LumaSpace adds about 2-3% CPU usage. When covered by windows, it drops to basically zero. Energy Impact stays in "Low" territory in Activity Monitor, which is where we want it: present when you're looking, gone when you're not.

It's not a trick and it isn't free, but it's close. It's just being careful about when to do work and when to stop, and letting the right piece of silicon do the part that's left.

Read next
Building for multiple displays was harder than we thought →Why we only make Mac apps →The problem with Mac cleanup apps →

Learn more about LumaSpace →