Skip to content

v1.0.0 — Hybrid WebGPU Proxy + Euclidean RGB Color-Key Alpha Matting Kernel

Choose a tag to compare

@utilvo utilvo released this 25 Nov 20:05
· 34 commits to main since this release
02088d2

Initial public release of browser-alpha-matting (v1.0.0) — a zero-dependency JavaScript/TypeScript alpha-matting and mask-refinement kernel for 100% client-side browser background removal.

Exported Functions

  • extractColorKeyAlpha(rgba, width, height, options) — $O(W \cdot H)$ 3D Euclidean RGB distance color-keying with anti-aliased tolerance/softness ramp.
  • fuseHybridAlpha(neuralAlpha, colorKeyAlpha, options) — $O(W \cdot H)$ hybrid fusion preserving soft neural hair/fur contours while carving enclosed typographic counters (O, A, B, P).
  • upsampleAlphaBilinear(proxyAlpha, proxyW, proxyH, targetW, targetH) — Pure TypedArray bilinear upsampling from 1024px neural proxy masks back to native 4K dimensions.
  • shiftAlphaBoundary(alpha, width, height, shiftPx) — Two-pass separable 1D morphological erosion (shiftPx < 0) and dilation (shiftPx > 0).
  • featherAlphaSeparable(alpha, width, height, radiusPx) — $O(W \cdot H)$ two-pass sliding-accumulator tent feathering independent of radiusPx.
  • decontaminateForegroundColors(rgba, alpha, width, height, passes) — Propagates opaque foreground RGB outward into semi-transparent boundary pixels to eliminate edge halos.
  • compositeNativeResolution(rgba, width, height, alpha, backdropRgb) — Lossless 32-bit transparent RGBA export or solid RGB backdrop flattening.
  • createMattingWorkerBridge(workerUrl) — Zero-copy Transferable ArrayBuffer Web Worker IPC wrapper for off-main-thread WebGPU/WASM inference.

Live Production Sandbox

Test the full hybrid WebGPU + Color-Key pipeline in the browser at https://utilvo.com/background-remover