1.5.0 • Published 2 months ago

transparent-background v1.5.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

Transparent Background (npm)

npm.io

transparent-background lets you easily remove backgrounds from images

Powered by InSPyReNet (ACCV 2022), thanks to @plemeri for creating transparent-background

  • Python must be installed system-wide
  • Works on Linux, macOS and Windows
    • Python is already pre-installed on macOS
    • If failing on Windows, you might have to install Python 3.8
pnpm install transparent-background
yarn add transparent-background
npm install transparent-background

Example

Before and after

import * as fs from "fs/promises";
import { transparentBackground } from "transparent-background";

// const fs = require("fs/promises");
// const { transparentBackground } = require("transparent-background");

(async () => {
	const input = await fs.readFile("test-input.png");

	const output = await transparentBackground(input, "png", {
		// uses a 1024x1024 model by default
		// enabling fast uses a 384x384 model instead
		fast: false,
	});

	await fs.writeFile("test-output.png", output);
})();
1.5.0

2 months ago

1.4.0

6 months ago

1.3.0

6 months ago

1.2.0

6 months ago

1.1.0

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0-1

6 months ago

1.0.0

6 months ago