remove-signature-bg
v0.3.2
Published
Signature background remover
Readme
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-bgEnvironment variables
Set these environment variables before using the package.
BG_REMOVER_API_URL: Background Remover API URLBG_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.
