Skip to content

v1.1.0 — Modular SDK, CIE76 Lab Color-Keying, Joint Bilateral 4K Upsampler, BFS Counter Analyzer & Benchmarks

Choose a tag to compare

@utilvo utilvo released this 25 Nov 21:07
· 10 commits to main since this release
d565824

What's New in v1.1.0

Modular SDK Architecture (src/)

  • src/color-key.js: extractColorKeyAlpha (3D Euclidean sRGB), rgbToLab, and extractPerceptualLabAlpha (CIE76 ΔE perceptual L*a*b* color-keying for unevenly lit paper scans & shadowed sweeps).
  • src/hybrid-fusion.js: fuseHybridAlpha dual-engine neural + color-key combiner and detectEnclosedCounters non-recursive BFS flood-fill analyzer separating interior glyph holes (O, A, B, P) from border-connected backgrounds.
  • src/upsample.js: upsampleAlphaBilinear and upsampleAlphaJointBilateral (RGB-guided edge-preserving 4K proxy-mask upsampler refining transition pixels 8 < α < 247).
  • src/morphology.js: shiftAlphaBoundary, featherAlphaSeparable (O(W·H) sliding-accumulator tent blur), and computeAlphaBoundingBox.
  • src/decontaminate.js: decontaminateForegroundColors (8-connected foreground RGB propagation) and compositeNativeResolution.
  • src/worker/: createMattingWorkerBridge (Transferable ArrayBuffer zero-copy client) and rmbg-worker.mjs (briaai/RMBG-1.4 WebGPU / WASM reference worker).
  • Includes strict TypeScript & Deno/JSR support (src/index.d.ts, tsconfig.json, jsr.json, mod.ts), test/advanced-kernels.test.mjs, runnable examples/, 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