crop-browser
![Package size](https://flat.badgen.net/bundlephobia/minzip/crop-browser)
Crop all transparent pixel around an image's edges.
Installation
NPM
You'll then need to bundle your code with a bundler.
npm install crop-browser
CDN
You don't need installation, just import from a CDN.
Usage
import crop from "crop-browser";
import crop from "https://www.unpkg.com/crop-browser";
(async () => {
const cropped = await crop("path/to/image.png");
document.body.appendChild(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