0

I have a canvas which updates every 2 seconds.
How do I create a gif animation with canvas?

Maybe there is a way by merging getImageData with each frame to create a GIF?

Jarrod
  • 9,349
  • 5
  • 58
  • 73
Artem Zubkov
  • 559
  • 1
  • 14
  • 29
  • 2
    *"...updates eche 2 seconds..."* Huh? "Every"? "Echo"? "Each"? – T.J. Crowder Feb 19 '13 at 22:25
  • Are you wanting an animated GIF exported from the animation on the Canvas? If so then really this is not something that you will be able to do - you can only retrieve the current state of the canvas, you cannot dynamically generate an animated GIF on the browser. It's just not something that it supports, even generating an image from the canvas won't work on all browsers that support canvas. – codefactor Feb 19 '13 at 22:33

1 Answers1

1

You can't create an animated Gif with canvas.

What you can do is create a sprite - which works in a very similar way to a gif. If you're asking if this can be saved to a file, then no. A sprite is purely for display on your screen.

Jarrod
  • 9,349
  • 5
  • 58
  • 73