remove-signature-bg

0.3.0 • Public • Published

Background Remover

This package removes backgrounds from images. Currently supporting only removing backgrounds from signatures.

Installation

npm i remove-signature-bg
# or
yarn add remove-signature-bg

Environment variables

Set these environment variables before using the package.

  • BG_REMOVER_API_URL: Background Remover API URL
  • BG_REMOVER_API_KEY: Background Remover secret API key

Basic usage

import { cleanSignature, isValidImage } from 'remove-signature-bg';

// Read signature from express-fileupload
const { signature } = req.files;

// Validate if the signature is actually an image
const isValid = isValidImage(signature.mimetype);

// Remove background from signature
// Accepts buffer and return buffer
await cleanSignature(signature.data);

Testing

The package has a Postman collection that use can you to test the implementation.

Start the local server with npm run dev and enjoy.

Package Sidebar

Install

npm i remove-signature-bg

Weekly Downloads

8

Version

0.3.0

License

ISC

Unpacked Size

9.29 kB

Total Files

16

Last publish

Collaborators

  • victorocna
  • mihaidulgheru