There's plenty of information about cropping images, but attempting to crop (or trim) animations produces strange results. Sometimes they flicker, or come with extra frames, or some frames crop correctly and others become offset. How do I prevent all this from happening?
convert input.gif -coalesce -repage 0x0 -crop WxH+X+Y +repage output.gif
-coalesce
rebuilds the full frames.-repage 0x0
.+repage
after the crop will do this.