jnordberg / gif.js

JavaScript GIF encoding library
http://jnordberg.github.io/gif.js/
MIT License
4.74k stars 668 forks source link

Usage in Node and a way to pass in a Buffer / a Base64 string of image data #113

Open TomasHubelbauer opened 4 years ago

TomasHubelbauer commented 4 years ago

Hi, first off, excuse my ignorance, but it looks like this library is aimed at the browser only? Is it possible to use it from Node? When I tried with the latest version, I got a not-a-constructor error. Perhaps I need to use a different way to require the module and the constructor is not the default export?

If this library is usable from Node, I'd like to follow up by inquiring about the possibility of passing a Buffer of image data or a Base64 string of image data to addFrame. Is this something you plan on supporting?

cuixiping commented 4 years ago

You can convert your Buffer / Base64 to an ImageData object.