jnordberg / gif.js

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

Add constructor option for transparent color #15

Closed beager closed 10 years ago

beager commented 10 years ago

This pull request adds the ability to specify a color to be treated as the "transparent" part of the GIF. You specify this upon instantiation like so:

var encoder = new GIF({
  workers: 2,
  quality: 10,
  transparent: 0x00FF00
});

This will set the transparent color to green, and when the GIF renders, any frame pixels that are #00ff00 will be transparent instead.

Potential issues:

jnordberg commented 10 years ago

Thanks

faace commented 8 years ago

It seems transparent doesn't work.... anybody met this problem?