jnordberg / gif.js

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

Pixel in upper left corner determines whether gif is opaque or transparent? #106

Open srdjan-m opened 5 years ago

srdjan-m commented 5 years ago

Hi there. I am experiencing really strange problem with the library. Somehow, the library doesn't render red colored pixels. At first I thought the transparency has something with it but further investigation proved me wrong... I created two examples to better explain my problem. Both examples uses 4 small 16x16px png images and opens a new window with gif blob... My source images are "data:image/png;base64..." strings. All the code is in html file.

http://markovi.ch/files/gif/index-bad.html This example opens a window with totally transparent gif. But source images are neither transparent nor settings are set for transparent colors.

but...

http://markovi.ch/files/gif/index-ok.html Creates the gif in the popup window which looks ok. The only difference is that I placed 1 pixel red dot in the upper-left corner of the source images.

Is this a bug or feature?