32

Are they any library to do so?

AFAIK dataToURL('image/gif') isn't supported by any browser

brillout
  • 7,804
  • 11
  • 72
  • 84

3 Answers3

36

Canvas can't generate (animated) GIFs. You need to use a JavaScript library to do so.

There is jsgif, a JS library to generate animated GIFs: http://github.com/antimatter15/jsgif

This blog post explains the usage: http://antimatter15.com/wp/2010/07/javascript-to-animated-gif/

NVI
  • 14,907
  • 16
  • 65
  • 104
leemes
  • 44,967
  • 21
  • 135
  • 183
9

omggif is a JavaScript implementation of a GIF 89a encoder.

https://github.com/deanm/omggif

brillout
  • 7,804
  • 11
  • 72
  • 84
1

https://github.com/spite/ccapture.js/ looks like an easier and better alternative to capture to gif or video.

SMUsamaShah
  • 7,677
  • 22
  • 88
  • 131