Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extracting single frames from an animated GIF to canvas

I need to load all the frames of an animated GIF to an HTML5 canvas.

Please note, I don't want to "play" the animated (someone asked this before), all I want is to extract all the frames to use them as single images.

like image 549
Omiod Avatar asked Jan 10 '11 09:01

Omiod


People also ask

How do I extract a frame from a GIF in Photoshop?

Go to File > Export > Render Video…, then select a folder to save the images to be extracted, choose Photoshop Image Sequence, select an image format, BMP, JPEG, PNG or TIFF, then click on Render button and each frame should be exported to an image in the selected format saved to the folder you have selected above.


1 Answers

Take a look at jsgif; it downloads a GIF, parses it, and draws the individual frames of the file to a <canvas>. With a bit of digging you should be able to find the code that draws the individual frames and work from there.

like image 107
tommitytom Avatar answered Nov 08 '22 03:11

tommitytom