How to create animated GIF images of a screencast?

view full story

http://askubuntu.com – I've seen animated GIF images of screen casts (like the one below) promoted a few times on this site as a way to improve answers. What toolchain is people using to create these? Is there a program that does this automagically, or are people taking screencasts, converting them into a series of static frames, and then creating the GIF images? (HowTos)