Or just use the free tool LICECAP (http://www.cockos.com/licecap/), record directly from the screen, export to GIF and avoid all that hassle.
However, I can see why this could be a cool learning experiment.
However, I can see why this could be a cool learning experiment.
If you're worried about size, just use the mp4.