Interpretation of “background colour index” in GIF specification

老子叫甜甜 提交于 2019-12-07 00:37:32

For the example, Safari uses black as the background. With Win10 photo viewer it's hard to tell, as it uses a black background anyway. Chrome, IE and Edge use white. The spec doesn't define the behaviour when there's no background colour and you need one, so I guess arbitrary choices is what you'll get, though I vote for transparent being the most sensible.

Yes, the ambiguity is indeed present. Background color is largely a derelict of GIF87a, currently only necessary for 'Restore Background' frame blending mode.

By now, all decoders I have seen treat pixels not belonging to any frame as transparent even if transparency flags in all of the frames are zeroed.

Consider this GIF, for example:

See how your browser interprets it? The whole background is transparent.

P.S.: in case it does not loop, reload the page using Ctrl+F5.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!