Make gif transparent color to be transparent black

Change it from transparent white to transparent black, which matches
the transparent color assumed in Webp dispose-to-background method.

Also pre-multiply background colors before comparison in anim_diff,
just as what is done with regular pixel values.

Change-Id: I5a790522df21619c666ce499f73e42294ed276f2
This commit is contained in:
hui su
2016-09-01 15:11:44 -07:00
parent 0887fc2d85
commit 43bd895879
3 changed files with 18 additions and 4 deletions

View File

@ -396,7 +396,7 @@ static uint32_t GetBackgroundColorGIF(GifFileType* gif) {
const ColorMapObject* const color_map = gif->SColorMap;
if (transparent_index != NO_TRANSPARENT_COLOR &&
gif->SBackGroundColor == transparent_index) {
return 0x00ffffff; // Special case: transparent white.
return 0x00000000; // Special case: transparent black.
} else if (color_map == NULL || color_map->Colors == NULL
|| gif->SBackGroundColor >= color_map->ColorCount) {
return 0xffffffff; // Invalid: assume white.