gif-capture-canvas

Capture a canvas with an animated gif

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
gif-capture-canvas
1601.1.02 years ago5 years agoMinified + gzip package size for gif-capture-canvas in KB

Readme

gif-capture-canvas
Capture a canvas with an animated gif (using jsgif).
Demo
demo

Usage


% npm i gif-capture-canvas

  • Capture HTMLCanvasElement in a requestAnimationFrame loop.

see: src/samples/lineart.ts
// 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
});