gif-capture-canvas
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

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
});

Readme

Keywords

none

Package Sidebar

Install

npm i gif-capture-canvas

Weekly Downloads

206

Version

1.1.0

License

MIT

Unpacked Size

15 kB

Total Files

8

Last publish

Collaborators

  • abagames