Remove the background with the shared BGT Light HQ-SAM library. Your photo stays in this
browser. No API key, upload or grading token is needed.
The first use downloads about 62 MiB (WASM) or 74 MiB (GPU) of model and runtime files. GPU
acceleration is used when available, with a CPU fallback. Later uses can reuse the browser
cache. Processing speed and memory depend on your device; an uncertain outline keeps the full
photo.
import { createCardCutout } from
'https://bestgradingtools.com/sdk/card-cutout/v1.1.0/index.js';
const engine = createCardCutout();
const result = await engine.crop(file, {
onProgress: stage => console.log(stage)
});
// result.blob · result.status · result.reason · result.elapsedMs
engine.close(); // Release model memory when finished.
For server processing use POST /v1/cutouts with your private BGT API key. Server requests
follow your plan’s quotas. Keep that key on your server.
Embedding on another website
If your site sets a Content Security Policy, merge these permissions into its existing
directives. The Worker needs both the SDK origin and local blob URLs.
Original · without flashReduced reflections · derived image
This is a presentation image. Reflections visible in both photos cannot be recovered.
Holographic colours may change; keep the originals for grading and defect inspection. Uncertain
alignment keeps the original. The output retains the photo background.
Use the JavaScript library
import { createCardFusion } from
'https://bestgradingtools.com/sdk/card-fusion/v1.0.1/index.js';
const engine = createCardFusion();
const result = await engine.combine(ambientFile, flashFile, {
signal: controller.signal,
onProgress: stage => console.log(stage)
});
// result.blob · result.status · result.reason · result.elapsedMs
// Keep the original and label a reduced result as a derived image.
engine.close();
First use loads about 10 MiB of OpenCV runtime. One reusable worker and a cache for the last
pair avoid repeat processing. No API key or grading tokens. No cross-origin isolation
required.