gif-capture-canvas
v1.1.0
Published
Capture a canvas with an animated gif
Downloads
1,043
Readme
gif-capture-canvas
Capture a canvas with an animated gif (using jsgif).
Usage
- Include build/index.js script or install from npm.
% npm i gif-capture-canvas
- Capture HTMLCanvasElement in a requestAnimationFrame loop.
// capture the canvas
gcc.capture(canvas);
- Push the capturing key (default: 'C') to output an animated gif.
Configuration
// set options (default values are shown below)
gcc.setOptions({
scale: 0.5,
durationSec: 3,
keyCode: 67, // 'C'
capturingFps: 20,
appFps: 60,
isAppendingImgElement: true,
quality: 10,
downloadFileName: null,
isSmoothingEnabled: true
});