Page 1 of 1

Trimming animated gif

Posted: 2010-11-19T11:30:07-07:00
by double
Hello,

This bug report belongs to this item:
viewtopic.php?f=1&t=17032

Testcase (47x29 pixels, coalesced):

Code: Select all

wget http://doppelbauer.name/test.gif
convert -verbose test.gif -layers optimize optimized.gif
identify optimized.gif
The problem, optimized.gif[2] is a full image (47x29 pixels), but only the left 31
pixels contain a non-transparent color. Therefore TrimBounds won't work.

Code: Select all

optimized.gif[0] GIF 31x29 47x29+0+0 8-bit PseudoClass 64c 9.46KiB 0.000u 0:00.000
optimized.gif[1] GIF 9x3 47x29+12+6 8-bit PseudoClass 64c 9.46KiB 0.000u 0:00.000
optimized.gif[2] GIF 47x29 47x29+0+0 8-bit PseudoClass 64c 9.46KiB 0.000u 0:00.000
optimized.gif[3] GIF 32x29 47x29+0+0 8-bit PseudoClass 64c 9.46KiB 0.000u 0:00.000
optimized.gif[4] GIF 35x28 47x29+0+0 8-bit PseudoClass 64c 9.46KiB 0.000u 0:00.000
optimized.gif[5] GIF 32x29 47x29+0+0 8-bit PseudoClass 64c 9.46KiB 0.000u 0:00.000
optimized.gif[6] GIF 31x29 47x29+0+0 8-bit PseudoClass 64c 9.46KiB 0.000u 0:00.000
optimized.gif[7] GIF 32x29 47x29+0+0 8-bit PseudoClass 64c 9.46KiB 0.000u 0:00.000
optimized.gif[8] GIF 35x28 47x29+0+0 8-bit PseudoClass 64c 9.46KiB 0.000u 0:00.000
optimized.gif[9] GIF 32x29 47x29+0+0 8-bit PseudoClass 64c 9.46KiB 0.000u 0:00.000
optimized.gif[10] GIF 31x29 47x29+0+0 8-bit PseudoClass 64c 9.46KiB 0.000u 0:00.000
optimized.gif[11] GIF 32x29 47x29+0+0 8-bit PseudoClass 64c 9.46KiB 0.000u 0:00.000
optimized.gif[12] GIF 35x28 47x29+0+0 8-bit PseudoClass 64c 9.46KiB 0.000u 0:00.000
optimized.gif[13] GIF 32x29 47x29+0+0 8-bit PseudoClass 64c 9.46KiB 0.000u 0:00.000
optimized.gif[14] GIF 31x29 47x29+0+0 8-bit PseudoClass 64c 9.46KiB 0.000u 0:00.000
optimized.gif[15] GIF 9x3 47x29+12+6 8-bit PseudoClass 64c 9.46KiB 0.000u 0:00.000
Thanks
Marcus

Re: Trimming animated gif

Posted: 2010-11-21T23:26:20-07:00
by anthony
This is a known problem, and one I have not had time to work on.

The bug is deep in the code, where at some point the frame comparison thinks two frames are completely different when that is definitely not the case. In my testing (last time I tried to track it down) it thought they were different even when the two frames are actually identical 'clones' of each other.

It was working when I first wrote the code, and nothing has changed in the code I wrote, but the comparison is failing! I posted a bug report about it at that time.

Re: Trimming animated gif

Posted: 2010-11-22T06:54:36-07:00
by magick
We're using ImageMagick 6.6.5-10, the current release. It appears to behave properly. We're getting:
  • optimized.gif[0] GIF 31x29 47x29+0+0 8-bit PseudoClass 64c 9.45KB 0.000u 0:00.000
    optimized.gif[1] GIF 9x3 47x29+12+6 8-bit PseudoClass 64c 9.45KB 0.000u 0:00.000
    optimized.gif[2] GIF 19x6 47x29+12+6 8-bit PseudoClass 64c 9.45KB 0.000u 0:00.000
    optimized.gif[3] GIF 32x29 47x29+0+0 8-bit PseudoClass 64c 9.45KB 0.000u 0:00.000

Re: Trimming animated gif

Posted: 2010-11-22T07:27:37-07:00
by double
You are right - sorry for disturbing.
Markus