rembg: Remove Image Backgrounds with Pre-Trained Segmentation Models

Remove the background from an image using pre-trained deep learning segmentation models ('U-2-Net', 'ISNet', 'BiRefNet' and others) run through the 'ONNX' Runtime via the 'onnxr' package. Given an image, a model predicts a foreground alpha matte which is composited into a cutout with a transparent (or solid-colour) background; optional closed-form alpha matting (ported from 'pymatting') refines soft edges. An R port of the Python 'rembg' package (<https://github.com/danielgatis/rembg>). Models are downloaded on first use and cached in a per-user cache directory.

Version: 0.1.1
Imports: onnxr, jpeg, png, Matrix, tools, utils
Suggests: tinytest, openssl
Published: 2026-07-22
DOI: 10.32614/CRAN.package.rembg (may not be active yet)
Author: Troy Hernandez ORCID iD [aut, cre], cornball.ai [cph], Daniel Gatis [cph] (Author of the Python 'rembg' package this is ported from)
Maintainer: Troy Hernandez <troy at cornball.ai>
BugReports: https://github.com/cornball-ai/rembg/issues
License: MIT + file LICENSE
URL: https://github.com/cornball-ai/rembg
NeedsCompilation: no
Materials: README, NEWS
CRAN checks: rembg results

Documentation:

Reference manual: rembg.html , rembg.pdf

Downloads:

Package source: rembg_0.1.1.tar.gz
Windows binaries: r-devel: not available, r-release: not available, r-oldrel: not available
macOS binaries: r-release (arm64): not available, r-oldrel (arm64): not available, r-release (x86_64): rembg_0.1.1.tgz, r-oldrel (x86_64): not available

Linking:

Please use the canonical form https://CRAN.R-project.org/package=rembg to link to this page.