
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Rembg lets you easily remove backgrounds from images using the U2-Net AI model
⚠️ This project is unmaintained. I wouldn't recommend using it either.
Some of the algorithms are missing and results are often not great.
I instead recommend you check out my other package:
https://github.com/makidoll/transparent-background-npm
Rembg lets you easily remove backgrounds from images using the U2-Net AI model
This is a loose port of the original Rembg for Python, big thanks to @danielgatis
It uses sharp for input and output so you can easily integrate it
The masking algorithm isn't fully complete yet, but the results are pretty good already!
yarn add sharp rembg-node
npm install sharp rembg-node
import { Rembg } from "rembg-node";
import sharp from "sharp";
// const { Rembg } = require("rembg-node");
// const sharp = require("sharp");
(async () => {
const input = sharp("test-input.jpg");
// optional arguments
const rembg = new Rembg({
logging: true,
});
const output = await rembg.remove(input);
await output.webp().toFile("test-output.webp");
// optionally you can use .trim() too!
await output.trim().webp().toFile("test-output-trimmed.webp");
})();
FAQs
Rembg lets you easily remove backgrounds from images using the U2-Net AI model
The npm package rembg-node receives a total of 58 weekly downloads. As such, rembg-node popularity was classified as not popular.
We found that rembg-node demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.