Skip to content

Instantly share code, notes, and snippets.

@8bitDesigner
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 8bitDesigner/6db8efd7a84282b20e3d to your computer and use it in GitHub Desktop.
Save 8bitDesigner/6db8efd7a84282b20e3d to your computer and use it in GitHub Desktop.
var GIFEncoder = require('gifencoder')
, fs = require('fs')
, path = require('path')
, encoder = new GIFEncoder(864, 486)
, pngFileStream = require('png-file-stream')
, dir = process.argv[2]
pngFileStream(path.join(dir, '*.png'))
.pipe(encoder.createWriteStream({ repeat: 0, delay: 100, quality: 10 }))
.pipe(fs.createWriteStream('myanimated.gif'))
{
"dependencies": {
"gifencoder": "^1.0.6",
"png-file-stream": "^1.0.0"
}
}
@8bitDesigner
Copy link
Author

Usage: node index.js path/to/folder/of/pngs/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment