pictures-trimmer
v1.0.4
Published
Node.js image trimmer by color (JPEG, PNG, BMP, TIFF, GIF)
Maintainers
Readme
pictures-trimmer
Node.js image trimmer by color (JPEG, PNG, BMP, TIFF, GIF, WebP, AVIF)
Installation:
This is a Node.js module, that can be run with the command line. First ensure you have npm installed, and then install as follows:
npm install -g pictures-trimmerUsage:
pictures-trimmer -c #ffffff [options]
Options:
--input, -i Input pictures extention to trim in case of directory path [string][default="jpeg,jpg,png,bmp,tiff,gif"]
--path, -p Path to the input file / directory [string][default="./"]
--verbose, -v Increase verbosity [boolean][default=false]
--saveas, -s true to overwrite current file, false to save as a copy [boolean][default=true]
--range, -r range to apply to each color channel [integer][default=0]
e.g. -r 5 -r 195,206,128 means trimming from
190,201,123 to 200,211,133Examples:
Trim a picture that has white background around subject
Use hexa color:
pictures-trimmer -p mypicture.png -i #ffffff
Use rgb color:
pictures-trimmer -p mypicture.png -i 255,255,255Trim every pictures in a directory
pictures-trimmer -p pictures/ -i #ffffffTrim every JPEG or PNG pictures in a directory
pictures-trimmer -p pictures/ -i jpeg,jpg,png -i #ffffff