Dirty Rectangle optimization refers to a mode of optimization that involves cropping frames in a GIF animation to their smallest needed rectangle. These frames are then placed on top of each other using pixel coordinates for placement.
Interframe transparency optimization
Another way to optimize an animation is to make redundant portions of animation frames transparent. This often, but not always, results in file size savings. This is done by using two features in the GIF file format: transparency and disposal methods. Some colors in a GIF file can be made transparent, allowing the background image or color to show through them. The same is true for frames in an animation — if parts of the frames are transparent, they show through to any other frames behind them. This is referred to as “Interframe Transparency” (some GIF animation utilities refer to it as “Frame Differencing”).
Minimize the bounding rectangle for the changed pixels in your animation.
One can achieve a substantial amount of frame optimization by minimizing the bounding rectangle within an animated .gif file to include only the areas which are being altered as a part of the animated presentation.
Apply interframe transparency optimization to the file.
Several software tools in the marketplace will allow designers to save only the pixels that have changed from frame to frame within an animated .gif file, also occasionally referred to as “frame differencing,” which can help to achieve a substantial amount of file size savings.
Frame positioning also lets you isolate the elements that change from frame to frame, and position them within the animation. GIFBuilder's “frame optimization” feature automatically crops away the non-changing areas in all but the first frame and keeps the rectangle that bounds the area(s) that change. The first frame acts as a background, and subsequent smaller frames layer over it. The resulting file can be dramatically smaller, as you aren't storing the entire frame, just the part that changes.
Combining frame optimization with the frame differencing stores only the pixels that actually change. I found that using the full-frame differences and letting GIFBuilder do the cropping and positioning was the best way to retain registration.