确定未覆盖的 GIF 像素的颜色

Determing the color of uncovered GIF pixels

这是一张只包含一张图片的 GIF,75 像素宽。

图像的图像描述符的图像左侧位置为 25。

所以图像最左边的25个像素没有被覆盖。由于 GIF specification 指出

The Background Color is the color used for those pixels on the screen that are not covered by an image.

背景颜色索引为 0,调色板中的第一个条目为 (0, 255, 0),我认为最左边的 25 个像素应该是绿色。

相反,浏览器将这些像素呈现为透明。

谁能告诉我这是为什么?我是否遗漏了规范中的内容?

我找到了 https://legacy.imagemagick.org/Usage/anim_basics/#dispose。在讨论为什么 ImageMagick 使用透明度处理方法 2 时,它指出(强调我的)

There is some thinking that rather than clearing the overlaid area to the transparent color, this disposal should clear it to the 'background' color meta-data setting stored in the GIF animation. In fact the old "Netscape" browser (version 2 and 3), did exactly that. But then it also failed to implement the 'Previous' dispose method correctly.

On the other hand the initial canvas should also be set from the formats 'background' color too, and that is also not done. However all modern web browsers clear just the area that was last overlaid to transparency, as such this is now accepted practice, and what IM now follows.