canvas-to-image
canvas-to-image extends FileSaver and simplifies way to save canvas as image.
Installation
$ npm install canvas-to-image
or
$ npm install @kaxi1993/canvas-to-image@2.2.0
Quick Start
; ; canvasEl // canvas html element or id attribute of canvas options = name: 'custom name' // default image type: 'jpg' // default png, accepted values jpg or png quality: 04 // default 1, can select any value from 0 to 1 range
Download as jpg
const canvasEl = document; ;
Download as png
; or ;
Examples
...
License
Copyright (c) 2020 Lasha Kakhidze. This code is released under the MIT license.