Repository navigation
Releases
Releases · utilvo/browser-alpha-matting
v1.1.2 — Cross-Platform Swift 5.9 & ClojureScript Reference Modules
Added
- Swift 5.9 Package (
Package.swift&Sources/BrowserAlphaMatting/BrowserAlphaMatting.swift): Pure Swift 5.9 reference module implementing cubic Hermite smoothstep alpha matting (3t^2 - 2t^3), BT.601 perceptual luma-weighted distance, foreground color-spill decontamination, and NEMA DICOM PS3.3 Section 10.7.1.3 anisotropic pixel-spacing Euclidean geometry across macOS, iOS, tvOS, and watchOS. - ClojureScript Reference Module: Cross-platform ClojureScript compatibility for client-side alpha-matting pipelines.
Interactive browser reference: https://utilvo.com/background-remover
v1.1.1 — Standardized publiccode.yml (v0.4) & CodeMeta 2.0 Archival Descriptors
What's New in v1.1.1
Standardized Public-Sector & Research Archival Metadata
publiccode.yml(v0.4): Added bilingual (en/de) European public-sector software descriptor detailing GDPR-compliant zero-egress client-side execution, input/output MIME types, platforms, and hybrid WebGPU/TypedArray capabilities.codemeta.json(v2.0): Added CodeMeta 2.0 archival descriptor with ORCID (0009-0002-1503-5639) and Software Heritage / Zenodo archival metadata (10.5281/zenodo.22975427).- Manifest Version Alignment: Updated
package.json(1.1.1),jsr.json(1.1.1), andCITATION.cff(cff-version: "1.1.1").
Live Demos
- GitHub Pages Live WebGPU
RMBG-1.4Sandbox: https://utilvo.github.io/browser-alpha-matting/ - Full Production Studio Reference: https://utilvo.com/background-remover
v1.1.0 — Modular SDK, CIE76 Lab Color-Keying, Joint Bilateral 4K Upsampler, BFS Counter Analyzer & Benchmarks
What's New in v1.1.0
Modular SDK Architecture (src/)
src/color-key.js:extractColorKeyAlpha(3D Euclidean sRGB),rgbToLab, andextractPerceptualLabAlpha(CIE76 ΔE perceptual L*a*b* color-keying for unevenly lit paper scans & shadowed sweeps).src/hybrid-fusion.js:fuseHybridAlphadual-engine neural + color-key combiner anddetectEnclosedCountersnon-recursive BFS flood-fill analyzer separating interior glyph holes (O,A,B,P) from border-connected backgrounds.src/upsample.js:upsampleAlphaBilinearandupsampleAlphaJointBilateral(RGB-guided edge-preserving 4K proxy-mask upsampler refining transition pixels8 < α < 247).src/morphology.js:shiftAlphaBoundary,featherAlphaSeparable(O(W·H) sliding-accumulator tent blur), andcomputeAlphaBoundingBox.src/decontaminate.js:decontaminateForegroundColors(8-connected foreground RGB propagation) andcompositeNativeResolution.src/worker/:createMattingWorkerBridge(TransferableArrayBufferzero-copy client) andrmbg-worker.mjs(briaai/RMBG-1.4WebGPU / WASM reference worker).- Includes strict TypeScript & Deno/JSR support (
src/index.d.ts,tsconfig.json,jsr.json,mod.ts),test/advanced-kernels.test.mjs, runnableexamples/, and GitHub Actions CI (Node.js 20.x & 22.x).
1080p & 4K UHD Throughput Benchmarks (npm run bench, Node.js v22 Single Thread)
| Kernel Stage | 1080p (1920×1080) |
4K UHD (3840×2160) |
Throughput |
|---|---|---|---|
fuseHybridAlpha (neural-with-counters) |
5.5 ms |
21.8 ms |
~376 MP/s |
extractColorKeyAlpha (3D Euclidean sRGB) |
11.9 ms |
40.9 ms |
~202 MP/s |
upsampleAlphaBilinear (1024px -> native) |
16.9 ms |
59.1 ms |
~140 MP/s |
featherAlphaSeparable (radius = 3px) |
35.1 ms |
141.0 ms |
~59 MP/s |
decontaminateForegroundColors (2 rings) |
72.9 ms |
290.0 ms |
~28 MP/s |
Live Demos
- GitHub Pages Live WebGPU
RMBG-1.4Sandbox: https://utilvo.github.io/browser-alpha-matting/ - Full Production Studio Reference: https://utilvo.com/background-remover
v1.0.0 — Hybrid WebGPU Proxy + Euclidean RGB Color-Key Alpha Matting Kernel
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)— PureTypedArraybilinear upsampling from1024pxneural proxy masks back to native4Kdimensions. -
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 ofradiusPx. -
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-copyTransferableArrayBufferWeb 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