ffmpeg images to gif

To convert a stack of jpegs (named psf_1.jpg, psf_2.jpg, ..., psf_n.jpg in this case) into a gif:

ffmpeg -f image2 -framerate 10 -i psf_%d.jpg psf.gif

If instead the individual files are named psf_001.jpg, psf_002.jpg and so on...

ffmpeg -f image2 -framerate 10 -i psf_%001d.jpg psf.gif