1.0.0 • Published 1 year ago

canvas-trim v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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)


Support me on Patreon - Check out my socials