Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

GIF disposal method

1,111 views
Skip to first unread message

Joris Van Damme

unread,
Oct 20, 2000, 3:00:00 AM10/20/00
to
Hi all!

This is a question about the disposal method in animated GIFs, but it
probably applies (partially) to MNGs too. I hope someone has an answer
(Mr Melander?) in spite of the detailed nature.

This is what the spec says about disposal methods:

0 - No disposal specified. The decoder is not required to take any
action.
1 - Do not dispose. The graphic is to be left in place.
2 - Restore to background color. The area used by the graphic must be
restored to the background color.
3 - Restore to previous. The decoder is required to restore the area
overwritten by the graphic with what was there prior to rendering the
graphic.

First, I don't understand the difference, if any, between disposal
method 0 and 1.

Secondly, is it possible that an image with delay=0 is followed by an
image with delay>0? The spec does not seem to forbid this, and it does
indeed seem to be a way to update several smallest possible 'dirty
rectangles' in one single animation time-frame. But, in this case, is it
possible that the disposal methods of these different dirty rectangles
composing one time-frame differ? What is a decoder to do if, say, for
example, the first dirty rectangle is disposal method 1 and the second
overlappes it partially and is disposal method 3? Is the 'previous' in
this case the previous time frame or the previous dirty rectangle? Or
should a decoder only pay attention to the disposal method specified in
the final dirty rectangle with the delay>0?

The spec does not seem to forbid all these situations and therefore I
wish to respond 'correct' too them, though it confuses me, and there are
probably few gifs in real life that actually pose these problems.

I do hope someone can answer this. Thanks very much in advance.

Joris


Anders Melander

unread,
Nov 8, 2000, 3:00:00 AM11/8/00
to
Joris Van Damme <as.van.da...@planetinternet.be> wrote:

>First, I don't understand the difference, if any, between disposal
>method 0 and 1.

There isn't any difference.


>Secondly, is it possible that an image with delay=0 is followed by an
>image with delay>0?

Yes, but most browsers enforce a minimum delay - Usually 10mS AFAIR.


>But, in this case, is it
>possible that the disposal methods of these different dirty rectangles
>composing one time-frame differ? What is a decoder to do if, say, for
>example, the first dirty rectangle is disposal method 1 and the second
>overlappes it partially and is disposal method 3? Is the 'previous' in
>this case the previous time frame or the previous dirty rectangle?

Previous means "what the image looked like before this frame" - it can include
all of the previous frames or none of them depending on their transparency and
disposal modes.
You don't have to worry too much about the "previous" disposal mode though.
AFAIR, none of the major browsers implement it so it can't really be used in
practice (TGIFImage implements it, but that's just for completeness).


>should a decoder only pay attention to the disposal method specified in
>the final dirty rectangle with the delay>0?

No.


>The spec does not seem to forbid all these situations and therefore I
>wish to respond 'correct' too them, though it confuses me, and there are
>probably few gifs in real life that actually pose these problems.

What I did when I wrote TGIFImage was to construct test GIFs with all these
different cases and test them in Netscape. It doesn't really matter what the GIF
specs say if the real world behaves differently. Netscape is pretty compliant
though.


Joris Van Damme

unread,
Nov 8, 2000, 10:07:01 PM11/8/00
to
Anders Melander wrote:
> What I did when I wrote TGIFImage was to construct test GIFs with all these
> different cases and test them in Netscape. It doesn't really matter what the GIF
> specs say if the real world behaves differently. Netscape is pretty compliant
> though.

Thank you very much, Anders!

Yeah, I was getting confused with things that actually do not exist in
'the read world'. But meanwhile, I've given up trying to get my answers
from the spec, and indeed I use netscape and explorer as a reference
instead.


Thanks again.

Joris

0 new messages