This guide will show you how to create animated gifs from sprites in an emulator. It deals with a specific emulator and tools, but the concept can be applied elsewhere, and there are other methods/tools.

Sprite Ripping Guide