Skip to content

Repository files navigation

🌐 English · 中文

LumiPic

Free, private, in-browser image toolkit — every pixel stays on your device.

Live On-device AI WebGPU Zero uploads License: MIT GitHub stars

AI background removal, smart compression, format conversion, precise cropping and EXIF stripping — all inside your browser. No uploads, no accounts, no watermarks, no limits. The model, the codecs, the whole pipeline run on your device.

Try it now → pic.sevzq.com

AI background removal running fully in the browser

Tools · Why it's different · Under the hood · Development · Deployment


Tools

Tool Engine
Remove Background BiRefNet_lite (SOTA dichotomous segmentation, MIT) via transformers.js + WebGPU, refined with a fast guided filter for hair-level edges
Compress Squoosh WASM codecs (MozJPEG / OxiPNG / WebP / AVIF) + TinyPNG-style palette quantization (image-q)
Convert PNG / JPG / WebP / AVIF output — iPhone HEIC, GIF and BMP input included
Crop Freeform marquee or ratio presets, rotate / flip, original format preserved
Strip EXIF Lossless container rewrite for JPEG / PNG / WebP — GPS, timestamps and device info gone, pixels untouched
Compress — 80% smaller, visually identical

Smart image compression demo
Convert — HEIC to AVIF in one step

Format conversion demo
Crop — exactly what you frame

Precise cropping demo
Strip EXIF — share the photo, not your location

Lossless EXIF removal demo

Batch up to 60 files (80 MB each), compare before/after with a slider, download one by one or as a ZIP. English and Chinese UI (/ and /zh).

Why it's different

Most "free online image tools" upload your photos to a server, queue them, watermark them, or cap you at N images per day. LumiPic can't do any of that — by architecture:

  • Zero uploads. Images are read into Web Workers and never leave the tab. There is no upload endpoint at all; the server only serves static files.
  • Self-hosted AI, no third-party CDN. The segmentation model (public/models/) and the ONNX runtime (public/ort/) are served from the same origin. After the first visit everything is cached — it even works offline.
  • State of the art, not a toy. BiRefNet is the current open-source SOTA for dichotomous segmentation; compression uses the exact codecs behind Squoosh.
  • Free forever. No account, no watermark, no daily quota — there is no server cost that would force any of those.

Zero uploads, 100% on-device, free forever

Under the hood

drop image ──▶ Web Worker (comlink RPC)
                 ├─ remove-bg   BiRefNet_lite fp16 · WebGPU · transformers.js
                 │              └─ guided-filter edge refinement at full resolution
                 ├─ compress    MozJPEG / OxiPNG / WebP / AVIF WASM (+ image-q palette)
                 ├─ convert     HEIC / GIF / BMP in → PNG / JPG / WebP / AVIF out
                 └─ strip-exif  lossless container rewrite
                       ▼
              transparent PNG / optimized file — straight back to your disk

Why the 512 model (and not 1024)

The app ships a single BiRefNet_lite graph: the 512px re-export (max 7 storage buffers), which runs on every WebGPU adapter. The 1024px graph was investigated in depth and is blocked in browsers by two independent walls — on every OS:

  1. Storage-buffer limit — the graph contains giant Concat (up to 1024 inputs) and Split (32 outputs) nodes; one shader needs 11 storage buffers, and macOS Metal exposes only 10. Fixable via graph surgery (scripts/patch-onnx-webgpu.py rewrites those nodes into trees of ≤ 8, verified bit-exact) — but then:
  2. WASM memory wall — the model's deformable-conv sampling ops (ScatterND / GatherND) aren't implemented in onnxruntime's WebGPU EP, so they bridge back to CPU WASM. At 1024² those intermediates exhaust the 32-bit WASM heap (std::bad_alloc) regardless of platform — reproduced even in Safari, whose adapter reports 44 storage buffers. 512² fits comfortably.

In practice the quality gap is small anyway: the guided-filter refinement always runs at the original resolution, so hair-level edges survive either way (an A/B of 512 vs 1024 through the same pipeline showed only marginal differences). Open /gpu-check.html on the deployed site to inspect your adapter.

Stack

  • Next.js 16 (App Router, standalone output) + TypeScript + Tailwind CSS v4
  • Motion (framer-motion v12) — spring physics UI animations
  • next-intl — English / Chinese, path-based routing
  • zustand + comlink — state and worker RPC
  • COOP / COEP headers — cross-origin isolation for multi-threaded WASM
  • Remotion — the landing-page demo clips are rendered React compositions (remotion/)

Development

pnpm install            # also copies the ONNX runtime into public/ort
pnpm fetch:models       # one-time ~95 MB model download into public/models
pnpm dev

The landing-page demo videos are Remotion compositions:

pnpm demos:studio       # live-edit the clips
pnpm demos:render       # re-render all mp4s into public/demos

Deployment

The Dockerfile fetches the models at build time and runs the standalone Next server — deploy it anywhere a container runs. For Railway:

railway up --service web

pic.sevzq.com is a proxied Cloudflare CNAME to the Railway service.

Design

"Figma-editorial" — monochrome chrome on a white canvas, one pastel color block per tool (lilac / lime / coral / mint / cream), Inter with tight display tracking, and a transparency checkerboard wherever alpha appears.

Contributing

Issues and PRs welcome. If LumiPic saved you an upload, ⭐ star the repo — it helps others find it.

License

MIT © SevenZhang

About

Free, private, in-browser image toolkit — AI background removal, compression, conversion, crop, EXIF strip. Every pixel stays on your device.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages