pamtogif

Convert a Netpbm image into an unanimated GIF image. See also: giftopnm, gifsicle. More information: https://netpbm.sourceforge.net/doc/pamtogif.html.

pamtogif path/to/image.pam > path/to/output.gif

pamtogif -transparent color path/to/image.pam > path/to/output.gif

pamtogif -comment "Hello World!" path/to/image.pam > path/to/output.gif