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
- Host: GitHub
- URL: https://github.com/rhaymisonbetini/remove-bg-node
- Owner: rhaymisonbetini
- Created: 2023-05-30T12:26:08.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-30T12:56:00.000Z (about 3 years ago)
- Last Synced: 2025-10-07T12:58:06.605Z (8 months ago)
- Topics: image-processing, javascript, nodejs, removebackground, removebg
- Language: JavaScript
- Homepage:
- Size: 513 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# REMOVE BACKGROUND FOR NODE.JS
Library for remove image background for node and python
# 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