#filmstrip2gif Convert a filmstrip image to an animated GIF in the browser.
filmstrip2gif
is designed to be used with browserify. To use it, include it in a browserified module:
var filmstrip2gif = require('filmstrip2gif')
var NUM_FRAMES = 10
, DURATION_SECONDS = 1
filmstrip2gif(document.querySelector('img.film').src, DURATION, NUM_FRAMES, false,
function(err, gifBlob) {
if (err) {
alert('oh no!: ' + err)
return
}
var img = document.createElement('img')
img.src = window.URL.createObjectURL(gifBlob)
docuument.body.appendChild(img)
})
var filmstrip2gif = require('filmstrip2gif')
filmstrip2gif(imgUrl, duration, numFrames, isHorizontal, cb)
Convert an image located at imgUrl (with known total duration duration
and number of
frames numFrames
, assumed to be evenly distributed) to an animated GIF, calling cb
when done.
cb
is a function(err, gifBlob)
. If isHorizontal
is true, the filmstrip will be sliced
into numFrames
pieces horizontally, vertically otherwise.
npm install filmstrip2gif
MIT