jnordberg / gif.js

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

Fix #109 Documentation for globalPalette option #126

Open cuixiping opened 4 years ago

iangilman commented 2 years ago

@cuixiping I'm not a maintainer on this project, so this is just my opinion, and I don't know if @jnordberg is still active here, so it might not make any difference, but you're more likely to get your documentation change merged if it doesn't also have a whole new feature in the same branch.

The localPalette feature seems like a good one, and it looks like you've done a good job with it (based on my quick perusal of the code; I'm not terribly familiar with this codebase, though), but it really should be in its own branch and separate pull request.

Anyway, thank you for making this documentation fix… It's how I discovered the globalPalette feature which I'm needing!

otizis commented 1 year ago

这个选项好像有个问题,全局调色盘的设置打开后似乎只会用第一帧的图像计算,导致后面帧出现的颜色只能从第一帧找相近的。比如第一帧是黑白的,那后面出现彩色的也无法找到彩色的,最后整个gif所有帧全部都变成黑白的了。

cuixiping commented 1 year ago

这个选项好像有个问题,全局调色盘的设置打开后似乎只会用第一帧的图像计算,导致后面帧出现的颜色只能从第一帧找相近的。比如第一帧是黑白的,那后面出现彩色的也无法找到彩色的,最后整个gif所有帧全部都变成黑白的了。

globalPalette can be true, false, or an array of [r,g,b,r,g,b,...]. If globalPalette is true the global palette will be created from the first frame.

You can set globalPalette as an array of rgb values as you need.