Page 1 of 1

Possibly wrong report regarding GIF transparency

Posted: 2017-04-19T12:11:54-07:00
by Storix
Hi,

Here is the GIF:

Image

The identify command-line tool reports that each frame has such transparent color:

Code: Select all

Transparent color: none
I used the following command:

Code: Select all

identify -verbose  cat.gif | grep -C 1 Transparent
I also tried to use this command (it was suggested here):

Code: Select all

convert cat.gif -coalesce -channel a -separate -scale 1x1! -format "%[fx:u]\n" info:
And it also reports that each GIF frame is non-transparent.

However, checking this GIF with gifsicle and verifying the appropriate bytes with a hex editor clearly shows that the frames have transparent colors:

Code: Select all

  + image #0 320x203 transparent 117
    disposal asis delay 0.30s
  + image #1 320x203 transparent 116
    local color table [128]
    disposal asis delay 0.20s
  + image #2 320x203 transparent 112
    local color table [128]
    disposal asis delay 0.10s
  + image #3 320x203 transparent 114
    local color table [128]
    disposal asis delay 0.10s
  + image #4 320x203 transparent 108
    local color table [128]
    disposal asis delay 0.10s
  + image #5 320x203 transparent 109
    local color table [128]
    disposal asis delay 0.10s
  + image #6 320x203 transparent 103
    local color table [128]
    disposal asis delay 0.10s
  + image #7 320x203 transparent 109
    local color table [128]
    disposal asis delay 0.10s
  + image #8 320x203 transparent 108
    local color table [128]
    disposal asis delay 0.10s
  + image #9 320x203 transparent 108
    local color table [128]
    disposal asis delay 0.10s
  + image #10 320x203 transparent 108
    local color table [128]
    disposal asis delay 0.10s
  + image #11 320x203 transparent 110
    local color table [128]
    disposal asis delay 0.10s
  + image #12 320x203 transparent 106
    local color table [128]
    disposal asis delay 0.10s
  + image #13 320x203 transparent 107
    local color table [128]
    disposal asis delay 0.10s
  + image #14 320x203 transparent 108
    local color table [128]
    disposal asis delay 0.10s
  + image #15 320x203 transparent 109
    local color table [128]
    disposal asis delay 0.10s
  + image #16 320x203 transparent 109
    local color table [128]
    disposal asis delay 0.10s
  + image #17 320x203 transparent 107
    local color table [128]
    disposal asis delay 0.10s
  + image #18 320x203 transparent 106
    local color table [128]
    disposal asis delay 0.10s
  + image #19 320x203 transparent 109
    local color table [128]
    disposal asis delay 0.10s
  + image #20 320x203 transparent 111
    local color table [128]
    disposal asis delay 0.10s
  + image #21 320x203 transparent 106
    local color table [128]
    disposal asis delay 0.10s
  + image #22 320x203 transparent 111
    local color table [128]
    disposal asis delay 0.10s
  + image #23 320x203 transparent 106
    local color table [128]
    disposal asis delay 0.10s
  + image #24 320x203 transparent 105
    local color table [128]
    disposal asis delay 0.10s
  + image #25 320x203 transparent 108
    local color table [128]
    disposal asis delay 0.10s
  + image #26 320x203 transparent 104
    local color table [128]
    disposal asis delay 0.10s
  + image #27 320x203 transparent 104
    local color table [128]
    disposal asis delay 0.10s
  + image #28 320x203 transparent 104
    local color table [128]
    disposal asis delay 0.10s
  + image #29 320x203 transparent 106
    local color table [128]
    disposal asis delay 0.10s
  + image #30 320x203 transparent 107
    local color table [128]
    disposal asis delay 0.10s
  + image #31 320x203 transparent 104
    local color table [128]
    disposal asis delay 0.10s
  + image #32 320x203 transparent 97
    local color table [128]
    disposal asis delay 0.10s
  + image #33 320x203 transparent 101
    local color table [128]
    disposal asis delay 0.10s
  + image #34 320x203 transparent 98
    local color table [128]
    disposal asis delay 0.10s
  + image #35 320x203 transparent 98
    local color table [128]
    disposal asis delay 0.10s
  + image #36 320x203 transparent 94
    local color table [128]
    disposal asis delay 0.10s
  + image #37 320x203 transparent 96
    local color table [128]
    disposal asis delay 0.10s
  + image #38 320x203 transparent 96
    local color table [128]
    disposal asis delay 0.10s
  + image #39 320x203 transparent 95
    local color table [128]
    disposal asis delay 0.10s
  + image #40 320x203 transparent 94
    local color table [128]
    disposal asis delay 0.10s
  + image #41 320x203 transparent 94
    local color table [128]
    disposal asis delay 0.10s
  + image #42 320x203 transparent 93
    local color table [128]
    disposal asis delay 0.10s
  + image #43 320x203 transparent 95
    local color table [128]
    disposal asis delay 0.10s
  + image #44 320x203 transparent 97
    local color table [128]
    disposal asis delay 0.10s
  + image #45 320x203 transparent 101
    local color table [128]
    disposal asis delay 0.10s
  + image #46 320x203 transparent 99
    local color table [128]
    disposal asis delay 0.10s
  + image #47 320x203 transparent 97
    local color table [128]
    disposal asis delay 0.10s
  + image #48 320x203 transparent 90
    local color table [128]
    disposal asis delay 0.10s
  + image #49 320x203 transparent 87
    local color table [128]
    disposal asis delay 0.10s
  + image #50 320x203 transparent 91
    local color table [128]
    disposal asis delay 0.10s
  + image #51 320x203 transparent 95
    local color table [128]
    disposal asis delay 0.10s
  + image #52 320x203 transparent 95
    local color table [128]
    disposal asis delay 0.10s
  + image #53 320x203 transparent 96
    local color table [128]
    disposal asis delay 0.10s
  + image #54 320x203 transparent 93
    local color table [128]
    disposal asis delay 0.10s
  + image #55 320x203 transparent 91
    local color table [128]
    disposal asis delay 0.10s
  + image #56 320x203 transparent 102
    local color table [128]
    disposal asis delay 0.10s
  + image #57 320x203 transparent 99
    local color table [128]
    disposal asis delay 0.10s
  + image #58 320x203 transparent 106
    local color table [128]
    disposal asis delay 0.10s
  + image #59 320x203 transparent 107
    local color table [128]
    disposal asis delay 0.10s
  + image #60 320x203 transparent 113
    local color table [128]
    disposal asis delay 0.10s
  + image #61 320x203 transparent 106
    local color table [128]
    disposal asis delay 0.10s
  + image #62 320x203 transparent 107
    local color table [128]
    disposal asis delay 0.10s
  + image #63 320x203 transparent 106
    local color table [128]
    disposal asis delay 0.10s
  + image #64 320x203 transparent 107
    local color table [128]
    disposal asis delay 0.10s
  + image #65 320x203 transparent 108
    local color table [128]
    disposal asis delay 0.10s
  + image #66 320x203 transparent 107
    local color table [128]
    disposal asis delay 0.10s
  + image #67 320x203 transparent 104
    local color table [128]
    disposal asis delay 0.10s
  + image #68 320x203 transparent 104
    local color table [128]
    disposal asis delay 0.10s
  + image #69 320x203 transparent 104
    local color table [128]
    disposal asis delay 0.10s
  + image #70 320x203 transparent 107
    local color table [128]
    disposal asis delay 0.10s
  + image #71 320x203 transparent 105
    local color table [128]
    disposal asis delay 0.10s
  + image #72 320x203 transparent 101
    local color table [128]
    disposal asis delay 0.10s
  + image #73 320x203 transparent 101
    local color table [128]
    disposal asis delay 0.10s
  + image #74 320x203 transparent 103
    local color table [128]
    disposal asis delay 0.10s
  + image #75 320x203 transparent 106
    local color table [128]
    disposal asis delay 0.10s
  + image #76 320x203 transparent 103
    local color table [128]
    disposal asis delay 0.10s
  + image #77 320x203 transparent 103
    local color table [128]
    disposal asis delay 0.10s
  + image #78 320x203 transparent 97
    local color table [128]
    disposal asis delay 0.10s
  + image #79 320x203 transparent 102
    local color table [128]
    disposal asis delay 0.10s
  + image #80 320x203 transparent 99
    local color table [128]
    disposal asis delay 0.10s
  + image #81 320x203 transparent 104
    local color table [128]
    disposal asis delay 0.10s
  + image #82 320x203 transparent 104
    local color table [128]
    disposal asis delay 0.10s
  + image #83 320x203 transparent 103
    local color table [128]
    disposal asis delay 0.10s
  + image #84 320x203 transparent 105
    local color table [128]
    disposal asis delay 0.10s
  + image #85 320x203 transparent 101
    local color table [128]
    disposal asis delay 0.10s
  + image #86 320x203 transparent 104
    local color table [128]
    disposal asis delay 0.10s
  + image #87 320x203 transparent 102
    local color table [128]
    disposal asis delay 0.10s
  + image #88 320x203 transparent 100
    local color table [128]
    disposal asis delay 0.10s
  + image #89 320x203 transparent 103
    local color table [128]
    disposal asis delay 0.10s
  + image #90 320x203 transparent 106
    local color table [128]
    disposal asis delay 0.10s
  + image #91 320x203 transparent 105
    local color table [128]
    disposal asis delay 0.10s
  + image #92 320x203 transparent 105
    local color table [128]
    disposal asis delay 0.10s
  + image #93 320x203 transparent 103
    local color table [128]
    disposal asis delay 0.10s
  + image #94 320x203 transparent 101
    local color table [128]
    disposal asis delay 0.10s
  + image #95 320x203 transparent 98
    local color table [128]
    disposal asis delay 0.10s
  + image #96 320x203 transparent 100
    local color table [128]
    disposal asis delay 0.10s
  + image #97 320x203 transparent 99
    local color table [128]
    disposal asis delay 0.10s
  + image #98 320x203 transparent 102
    local color table [128]
    disposal asis delay 0.10s
  + image #99 320x203 transparent 103
    local color table [128]
    disposal asis delay 0.10s
  + image #100 320x203 transparent 100
    local color table [128]
    disposal asis delay 0.10s
  + image #101 320x203 transparent 106
    local color table [128]
    disposal asis delay 0.10s
  + image #102 320x203 transparent 102
    local color table [128]
    disposal asis delay 0.10s
  + image #103 320x203 transparent 102
    local color table [128]
    disposal asis delay 0.10s
  + image #104 320x203 transparent 105
    local color table [128]
    disposal asis delay 0.10s
  + image #105 320x203 transparent 110
    local color table [128]
    disposal asis delay 0.10s
  + image #106 320x203 transparent 105
    local color table [128]
    disposal asis delay 0.10s
  + image #107 320x203 transparent 108
    local color table [128]
    disposal asis delay 0.10s
  + image #108 320x203 transparent 100
    local color table [128]
    disposal asis delay 0.10s
  + image #109 320x203 transparent 106
    local color table [128]
    disposal asis delay 0.10s
  + image #110 320x203 transparent 106
    local color table [128]
    disposal asis delay 0.10s
  + image #111 320x203 transparent 103
    local color table [128]
    disposal asis delay 0.10s
  + image #112 320x203 transparent 101
    local color table [128]
    disposal asis delay 0.10s
  + image #113 320x203 transparent 105
    local color table [128]
    disposal asis delay 0.10s
  + image #114 320x203 transparent 94
    local color table [128]
    disposal asis delay 0.10s
  + image #115 320x203 transparent 97
    local color table [128]
    disposal asis delay 0.10s
  + image #116 320x203 transparent 100
    local color table [128]
    disposal asis delay 0.10s
  + image #117 320x203 transparent 96
    local color table [128]
    disposal asis delay 0.10s
  + image #118 320x203 transparent 90
    local color table [128]
    disposal asis delay 0.10s
  + image #119 320x203 transparent 87
    local color table [128]
    disposal asis delay 0.10s
  + image #120 320x203 transparent 97
    local color table [128]
    disposal asis delay 0.10s
  + image #121 320x203 transparent 96
    local color table [128]
    disposal asis delay 0.10s
  + image #122 320x203 transparent 95
    local color table [128]
    disposal asis delay 0.10s
  + image #123 320x203 transparent 94
    local color table [128]
    disposal asis delay 0.10s
  + image #124 320x203 transparent 99
    local color table [128]
    disposal asis delay 0.10s
  + image #125 320x203 transparent 97
    local color table [128]
    disposal asis delay 0.10s
  + image #126 320x203 transparent 96
    local color table [128]
    disposal asis delay 0.10s
  + image #127 320x203 transparent 98
    local color table [128]
    disposal asis delay 0.10s
  + image #128 320x203 transparent 99
    local color table [128]
    disposal asis delay 0.10s
  + image #129 320x203 transparent 95
    local color table [128]
    disposal asis delay 0.10s
  + image #130 320x203 transparent 97
    local color table [128]
    disposal asis delay 0.10s
  + image #131 320x203 transparent 102
    local color table [128]
    disposal asis delay 0.10s
  + image #132 320x203 transparent 94
    local color table [128]
    disposal asis delay 0.10s
  + image #133 320x203 transparent 93
    local color table [128]
    disposal asis delay 0.10s
  + image #134 320x203 transparent 94
    local color table [128]
    disposal asis delay 0.10s
  + image #135 320x203 transparent 95
    local color table [128]
    disposal asis delay 0.10s
  + image #136 320x203 transparent 97
    local color table [128]
    disposal asis delay 0.10s
  + image #137 320x203 transparent 96
    local color table [128]
    disposal asis delay 0.10s
  + image #138 320x203 transparent 92
    local color table [128]
    disposal asis delay 0.10s
  + image #139 320x203 transparent 94
    local color table [128]
    disposal asis delay 0.10s
  + image #140 320x203 transparent 93
    local color table [128]
    disposal asis delay 0.10s
  + image #141 320x203 transparent 96
    local color table [128]
    disposal asis delay 0.10s
  + image #142 320x203 transparent 95
    local color table [128]
    disposal asis delay 0.10s
  + image #143 320x203 transparent 97
    local color table [128]
    disposal asis delay 0.10s
  + image #144 320x203 transparent 93
    local color table [128]
    disposal asis delay 0.10s
  + image #145 320x203 transparent 93
    local color table [128]
    disposal asis delay 0.10s
  + image #146 320x203 transparent 94
    local color table [128]
    disposal asis delay 0.10s
  + image #147 320x203 transparent 98
    local color table [128]
    disposal asis delay 0.10s
  + image #148 320x203 transparent 93
    local color table [128]
    disposal asis delay 0.10s
  + image #149 320x203 transparent 95
    local color table [128]
    disposal asis delay 0.10s
  + image #150 320x203 transparent 100
    local color table [128]
    disposal asis delay 0.10s
  + image #151 320x203 transparent 100
    local color table [128]
    disposal asis delay 0.10s
  + image #152 320x203 transparent 100
    local color table [128]
    disposal asis delay 0.10s
  + image #153 320x203 transparent 99
    local color table [128]
    disposal asis delay 0.10s
  + image #154 320x203 transparent 98
    local color table [128]
    disposal asis delay 0.10s
  + image #155 320x203 transparent 99
    local color table [128]
    disposal asis delay 0.10s
  + image #156 320x203 transparent 96
    local color table [128]
    disposal asis delay 0.10s
  + image #157 320x203 transparent 101
    local color table [128]
    disposal asis delay 0.10s
  + image #158 320x203 transparent 109
    local color table [128]
    disposal asis delay 0.10s
  + image #159 320x203 transparent 119
    local color table [128]
    disposal asis delay 0.10s
  + image #160 320x203 transparent 119
    local color table [128]
    disposal asis delay 0.10s
  + image #161 320x203 transparent 125
    local color table [128]
    disposal asis delay 0.10s
  + image #162 320x203 transparent 119
    local color table [128]
    disposal asis delay 0.10s
  + image #163 320x203 transparent 122
    local color table [128]
    disposal asis delay 0.10s
  + image #164 320x203 transparent 120
    local color table [128]
    disposal asis delay 0.10s
  + image #165 320x203 transparent 123
    local color table [128]
    disposal asis delay 0.10s
  + image #166 320x203 transparent 125
    local color table [128]
    disposal asis delay 0.10s
  + image #167 320x203 transparent 122
    local color table [128]
    disposal asis delay 0.10s
  + image #168 320x203 transparent 122
    local color table [128]
    disposal asis delay 0.10s
  + image #169 320x203 transparent 123
    local color table [128]
    disposal asis delay 0.10s
  + image #170 320x203 transparent 121
    local color table [128]
    disposal asis delay 0.10s
  + image #171 320x203 transparent 121
    local color table [128]
    disposal asis delay 0.10s
  + image #172 320x203 transparent 118
    local color table [128]
    disposal asis delay 0.10s
  + image #173 320x203 transparent 116
    local color table [128]
    disposal asis delay 0.10s
  + image #174 320x203 transparent 112
    local color table [128]
    disposal asis delay 0.10s
  + image #175 320x203 transparent 119
    local color table [128]
    disposal asis delay 0.10s
  + image #176 320x203 transparent 119
    local color table [128]
    disposal asis delay 0.10s
  + image #177 320x203 transparent 120
    local color table [128]
    disposal asis delay 0.10s
  + image #178 320x203 transparent 121
    local color table [128]
    disposal asis delay 0.10s
  + image #179 320x203 transparent 117
    local color table [128]
    disposal asis delay 0.10s
  + image #180 320x203 transparent 115
    local color table [128]
    disposal asis delay 0.10s
  + image #181 320x203 transparent 114
    local color table [128]
    disposal asis delay 0.10s
  + image #182 320x203 transparent 116
    local color table [128]
    disposal asis delay 0.10s
  + image #183 320x203 transparent 117
    local color table [128]
    disposal asis delay 0.10s
  + image #184 320x203 transparent 116
    local color table [128]
    disposal asis delay 0.10s
  + image #185 320x203 transparent 114
    local color table [128]
    disposal asis delay 0.10s
  + image #186 320x203 transparent 111
    local color table [128]
    disposal asis delay 0.10s
  + image #187 320x203 transparent 110
    local color table [128]
    disposal asis delay 0.10s
  + image #188 320x203 transparent 110
    local color table [128]
    disposal asis delay 0.10s
  + image #189 320x203 transparent 111
    local color table [128]
    disposal asis delay 0.10s
  + image #190 320x203 transparent 111
    local color table [128]
    disposal asis delay 0.10s
  + image #191 320x203 transparent 113
    local color table [128]
    disposal asis delay 0.10s
  + image #192 320x203 transparent 107
    local color table [128]
    disposal asis delay 0.20s
  + image #193 320x203 transparent 109
    local color table [128]
    disposal asis delay 0.30s
  + image #194 320x203 transparent 109
    local color table [128]
    disposal asis delay 0.40s
Just in case, here is the gifsicle command:

Code: Select all

gifsicle -II cat.gif
So I'm wondering is this a bug or ImageMagick just uses some clever algorithm to detect whether the transparent color is really used in a GIF frame? I'm actually looking for such algorithm :) Thanks.

Re: Possibly wrong report regarding GIF transparency

Posted: 2017-04-19T12:36:36-07:00
by fmw42
Not every frame has transparent color of none. Your first frame reports Transparent color: srgba(171,172,173,0).

Sorry but I am not really sure what you are asking?

Please always provide your IM version and platform.

Re: Possibly wrong report regarding GIF transparency

Posted: 2017-04-19T13:30:52-07:00
by Storix
I'm sorry if my question wasn't clear enough. I'll ask it again.

IM Version: ImageMagick 7.0.5-4 Q16 x86_64 2017-03-25
Platform: macOS Sierra 10.12.3

Why identify utility reports for all (except the first one) GIF frames Transparent color: none? It seems that this is incorrect because:

1. gifsicle reports different transparent color values
2. the values reported by gifsicle were verified using the hex editor.