crop-node
![Package size](https://flat.badgen.net/bundlephobia/minzip/crop-node)
Crop all transparent pixel around an image's edges. (CLI version)
Installation
npm install crop-node
Usage
import crop from "crop-node";
import { writeFileSync } from "fs";
const path = "path/to/image.png";
const options = {
outputFormat: "png",
};
(async () => {
const cropped = await crop(path, options);
writeFileSync("cropped.png", cropped);
})();
Documentation
crop(input, [options])
options
Name | Type | Default | Comment |
---|
outputFormat | String | "png" | Format of the output image ("png" or "jpeg" ) |
In addition, all options of detect-edges
are supported.
Related
License
MIT