backrem
v1.1.0
Published
Tool to replace "plain-color" background on images.
Downloads
6
Readme
Backrem
Tool to replace "plain-color" background on images.
This tool provides a function called replaceBackground
. This function has 2 required arguments and 2 optional:
- Image to replace background (readable stream)
- Background image (readable stream, should have the same size as image in first argument)
- Color to detect background (array of 3 numbers RGB)
- Threshold - number from 0 to 100, where 0 means to replace only color from third argument, higher means similarity of colors
Read more about colors similarity here: https://stackoverflow.com/questions/13586999/color-difference-similarity-between-two-values-with-js
This function returns readable stream with result image.
You can also see working example in example
directory.