lapstack
Free software · MIT · runs in your browser

Every frame sharp, in one image.

lapstack fuses a focus-bracketed series of photographs into a single all-in-focus picture and a dense depth map. The whole engine runs on WebGPU in a browser tab — a 25-frame, 45-megapixel stack in about sixteen seconds, with nothing uploaded anywhere. Open a tab and it is yours; there is nothing to install and nothing to buy.

The whole application is free, in every form: the browser app, the desktop application, the command-line tool and the Lightroom plugin, with the source on GitHub under the MIT license.

Your images never leave your machine

There is no upload and no server compute. Frames are decoded, aligned, fused and saved inside the browser tab, on your own GPU. Close the tab and nothing of the session remains anywhere but the files you saved. There is no account to make.

Fusion

Laplacian pyramid

Band-pass decomposition with maximum-region-energy selection, generalized from two frames to any number. Blending happens in the reconstruction itself, so there are no seams to hide. Optional halo control removes the rim a pyramid can leave beside a bright object.

Depth

Depth from focus, free

Every run produces a dense, sub-frame depth map and a confidence map — the ring difference filter, guided-filter aggregation and an edge-aware weighted-least-squares solve. It costs no measurable time on a 25-frame run, because each frame's focus slice is taken as the frame is folded.

Raw

Raw in, linear DNG out

NEF, CR2, CR3, ARW, DNG, RAF, ORF, RW2 and the rest are read directly. Write the stack back as a linear DNG in the camera's own color space and your raw converter develops it like a raw — exposure, white balance, profile and highlight recovery all still open.

Retouch

Brush from slabs

Paint one rendering into another: a source frame, a thick slab of frames fused on demand, a kept result from an earlier run, or the depth-map rendering into the pyramid image and back. Sixteen-bit throughout, with whole-stroke undo.

Output

Stereo, rocking and 3D

The depth map turns the result into a relief: a stereo pair for parallel, cross-eyed or anaglyph viewing, a rocking animation as GIF, MP4 or WebM, and a textured 3D model as GLB, OBJ or STL.

Microscopy

Figures, not just pictures

A calibrated scale bar and a caption burned into the result, reading their calibration from ImageJ or OME-TIFF metadata when the frames carry it, and sized as a fraction of the image so the same settings give the same figure at any resolution.

Fast, and honest about it

Measured on 8280 × 5520 sixteen-bit frames, an RTX 3060 and a 128-thread host. Every figure is the whole run, depth pass included. The first is a browser tab; the rest are the native command-line tool.

16 s25 frames in the browser, on WebGPU
9.6 s25 frames, native with CUDA
26 s25 frames, native CPU only
26 s100 frames, native with CUDA

Memory does not grow with the stack: frames stream through alignment and fusion one at a time, so a hundred-frame run holds no more than a handful of frames at once. Full numbers and method →

One engine, four ways to run it

One engine, written once, with different shells around it. All of them are free software under the MIT license, and every capability the engine has is on in each of them. Nothing is for sale.

Browser

Nothing to install Free

Open a tab and drop your frames in. WebGPU and WebAssembly do the work on your own hardware. Chrome, Edge and Safari 26 have WebGPU on by default; Firefox and Linux need a little setup. Full resolution, no watermark, no frame limit.

Open lapstack →

Desktop

The same app, packaged Free

The browser app wrapped in Electron for Linux, Windows and macOS, with WebGPU already configured and native folder and save dialogs. No launcher flags, no browser setup. Published with each release on GitHub.

Download →

Command line

Unlimited stacks, scripted Free

A native binary with no stack-size ceiling, CUDA or any other GPU through the browser's own kernels, batch splitting by count, capture-time gap or folder, a tethered watch mode, and a Lightroom Classic plugin that makes it an export target.

CLI manual →

Source

Yours to read and change MIT

The whole repository — the engine, the browser app, the desktop shell, the plugin — under the MIT license: use it, change it, build something of your own on it, commercially or not. The one LGPL component, the raw decoder, is kept a module of its own.

github.com/ragtux/LAPSTACK →

Written from the papers

lapstack is a from-scratch implementation, not a wrapper around anything. The pyramid is Burt and Adelson's; the fusion rule is Wang and Chang's maximum region energy; the depth pass is the modern non-learned depth-from-focus recipe — Jeon's ring difference filter, He's guided filter, Farbman's weighted least squares, solved by a multigrid-preconditioned conjugate gradient. How it works →