Skip to content

multi-model · 2 Web Workers · 71.8 MB total ORMBG (44.3 MB) → Morphological Trimap → ViTMatte (27.5 MB) Both Apache-2.0 WASM q8

Auto-Mask → Morphological Trimap → ViTMatte Refinement

Zero manual trimap brushing: Stage 1 runs commercial-safe onnx-community/ormbg-ONNX (44.3 MB IS-Net) to isolate the foreground silhouette, an exact Euclidean distance transform erodes & dilates the boundary into a 3-class trimap, and Stage 2 runs Xenova/vitmatte-small-distinctions-646 (27.5 MB) to recover fine hair, whiskers, and fur alpha transitions.

Two-Stage Automatic Hair & Fur Refinement Pipeline

Loading sample photo…

Stage 1 · ORMBG Cutout

Awaiting Stage 1…

Morphological Trimap

Erode 10 / Dilate 16 px

Stage 2 · ViTMatte Refined

Awaiting Stage 2…

Refinement Delta Heatmap

|ViTMatte − ORMBG|
Stage 1 (ORMBG)–
Stage 2 (ViTMatte)–
Unknown Trimap Band–
Unknown-Band MAD–
Binary FG IoU–
Soft-Edge Gain (S2−S1)–
4-Ch Tensor Dims–

Engine & Local Models (71.8 MB total)

Stage 1 · ORMBG Foreground Mask (44.3 MB)

Reuses ../../ormbg-background-removal/worker.js — onnx-community/ormbg-ONNX, Apache-2.0 IS-Net WASM q8.

Stage 2 · ViTMatte-Small Alpha Refiner (27.5 MB)

Runs ../worker.js — Xenova/vitmatte-small-distinctions-646, Apache-2.0 4-ch ViTDet WASM q8.

See inside the morphological trimap bridge

Show the code — exact Euclidean distance erode/dilate trimap synthesis