How can I modify a GIF that uses "cumulative layers"?
When you save a GIF in GIMP, you're given the option to use cumulative layers (combine) or one frame per layer (replace).
Choosing cumulative layers causes the GIF's layers to only contain the pixels that changed since the last frame.
Choosing one frame per layer causes each of the GIF's layers to save all of its pixels, not relying on any of the pixels from the last frame.
If a GIF has been previously saved with cumulative layers, and I delete the first few frames, it messes up the rest of the GIF because the later frames were relying on the (now deleted) color information from the first frames.
Here's an example:
After deleting the first two frames:
How can I save the modified GIF so that it looks correct?
This is real easy in gimp. You unoptimize the gif to reveal all pixel data in layers (filters/animation/unoptimize). Delete the layers, 2 first in your case, then optimize it again (filters/animation/optimize for gif) Export as gif, tick the animation box.
The whole idea behind Cumulative (Combine) is to cut down the size of the file by eliminating the parts that don't change and keeping the bits that do. If you want to go the Replace route (and I can't imagine why, but okay), make a copy of the first layer and merge the copy with the next layer up. Then make a copy of the new layer and merge that with the next layer up. And so on, ad naus. Save as animation.
Yes, it's a rather clunky solution.