An open API service indexing awesome lists of open source software.

https://github.com/rhaymisonbetini/remove-bg-node

Library for remove image background for node and python
https://github.com/rhaymisonbetini/remove-bg-node

image-processing javascript nodejs removebackground removebg

Last synced: 20 days ago
JSON representation

Library for remove image background for node and python

Awesome Lists containing this project

README

          

# REMOVE BACKGROUND FOR NODE.JS

Library for remove image background for node and python





npm
npm














# INSTALL

To use this library you will need to have Python installed in your environment.
Ensuring you have Python run the command:
``` shell
pip install rembg
```

Now install our library

```shell
npm install remove-bg-node
```

# HOW TO USE

Import the library on your system with

``` javascript
const RemoveBackground = require('remove-bg-node');
```

or

``` javascript
import RemoveBackground from 'remove-bg-node';
```
Now you must create an instance of your class.

``` javascript
let rm = new RemoveBackground();
```
We will call the main method and we will pass the directory of our image and the directory
to which we must save our image without the background

full example
```javascript

'use strict'
const RemoveBackground = require('remove-bg-node');
let rm = new RemoveBackground();
let current = __dirname + '/teste/cristian.jpg';
let save = __dirname + '/deploy';
await rm.asyncRemoveBackground(current, save)

```
ps:A file with the same name will be generated.

Result

Before:



After