问题
Does anyone have a simple solution to extract frames from a gif using javascript?
I know some online tools like Ezgif and Gif-explode, but I'm wondering if this is also possible using just javascript?
回答1:
For a client-side solution I'd recommend to have a look at libgif-js. It allows to step to a specific frame in the GIF and you could then use the Canvas API to capture a single frame by drawing the image to the canvas and then getting the Data URL.
来源:https://stackoverflow.com/questions/39309560/how-to-extract-frames-from-an-animated-gif-using-javascript