I don't fully understand what you are trying to achieve. Load a gif file and display it on a Lazarus form? For this, add unit fpreadgif to "uses" and call Image1.Picture.LoadFromFile(name_of_gif_file) for an image on the form. However, this does not support animated gifs and has some more drawbacks. For a complete gif viewer you can install GifAnim or GifViewer from the online-package-manager.
If you are trying to write a gif you'll have to live with little support here. GifAnim and GifViewer do not support writing at all. There is a tweak to provide a unit fpwritegif for fcl - search the forum, it was recently discussed -, but this is not for animated images.