ffmpeg is my go to for things like this but I can never remember the necessary incantation on the command line. Fortunately ChatGPT tends to get you most of the way there a lot of the time, I would normally asks something like the following and start from there:
How to convert a folder of png images into a gif using ffmpeg?