Skip to content

v1.0.0

Choose a tag to compare

@privatenumber privatenumber released this 24 Aug 02:36
· 11 commits to develop since this release
v1.0.0

unbg removes a solid background by comparing two pixel-aligned images of the same subject on different background colors. Difference matting recovers soft edges, anti-aliasing, glows, and partial transparency instead of estimating a hard mask.

Included

  • CLI support for PNG, JPEG, and static WebP inputs with PNG output
  • Node.js API for encoded image bytes
  • Browser-safe core API for raw RGBA pixels
  • Automatic background detection with explicit color overrides
  • Alpha floor and ceiling controls for artifact cleanup
  • Transparent-edge cropping with an optional alpha threshold
  • Local browser processing through a Web Worker

Install with npm install unbg, run it directly with npx unbg, or try it online.

npm package