canvas-trim
v1.0.0
Published
Trim whitespace from a canvas
Downloads
2
Maintainers
Readme
canvas-trim
Trim whitespace from a canvas
Installation
npm i canvas-trim
Usage
canvasTrim(document.querySelector('#myCanvas'));
const trimmed = canvasTrim(document.querySelector('#myCanvas'));
trimmed.toBlob(function(blob) {
console.log(URL.createObjectURL(blob));
}, "image/jpeg", 0.75);
credit: ourcodeworld.com (Carlos Delgado)