jnordberg / gif.js

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

Support transparency and reserved colors in the palette #5

Open leeoniya opened 11 years ago

leeoniya commented 11 years ago

It would also be good if rgba(0,0,0,0) pixels are converted to the transparent color

jnordberg commented 11 years ago

(re-worded the issue slightly)

beager commented 10 years ago

This should be fairly straightforward as the GIFEncoder object exposes a setTransparent(number) method. If I can get hip to the coffeescript I might try to mess with this and open a PR.

Also, it seems that setTransparent() refers to a color in the table, not a specific hex color?

beager commented 10 years ago

I have submitted #15 that will allow you to explicitly set a background color when instantiating the encoder. This does not address reserved colors.

As for rgba(0,0,0,0), I'm not sure how all of that would work. All of my experience is with converting a canvas context, which in my experience has some full-alpha color at all times.

1j01 commented 9 years ago

:+1: for rgba(0,0,0,0) transparency