gif.js
gif.js copied to clipboard
options.background not work
options.background
not work, there is no such property: ctx.setFill
.
Ref: https://github.com/jnordberg/gif.js/blob/060595539daeec3cf919754cee398ba0b3ef57f4/src/gif.coffee#L170
https://github.com/jnordberg/gif.js/pull/46
var encoder = new GIFEncoder(878,759); encoder.repeat = 0; encoder.delay = 10; encoder.quality = 10; encoder.background = 0xFFFFFF; encoder.setTransparent(0xFFFFFF); pngFileStream('out/goat/Armature-goat_eat_anim_?.png') .pipe(encoder.createWriteStream({})) .pipe(fs.createWriteStream('out/goat_eat.gif'))
my code is like this,but the background is still black color. It looks like "background" and "transparent" do not work.
ctx.setFill = @options.background in gif.coffee should be: ctx.fillStyle = @options.background I'd submit a pull request except I don't know how. You could just change setFill to fillStyle in gif.js.
The fix proposed by @jormaturkenburg seems the right way to handle this. Do you have any plan for updating the library, please?