Using ffmpeg, what command would I use to concatenate a folder of images named joe01.png, joe02.png etc. into a gif called JOE.gif? Please provide a simple code sample, and further code samples demonstrating how to 1: reduce filesize 2: improve the quality of the generated .gif
You can do this with the following ffmpeg command:

```ffmpeg -i '*.png' -vf fps=1 out.gif```
This will take all the PNG files in the current directory and output an animated GIF named `out.gif` that shows one frame for each image. The default frame rate is set to 1 frame per second (fps). You can adjust the frame rate by changing the value after `-i`.

To reduce the file size of the resulting GIF, you can specify the "-crf" option to control the motion blur strength. A higher value will result in a smaller file size but may also introduce some noise or artifacts. Try experimenting with different values to find the optimal setting for your particular situation.

Finally, you can improve the quality of the final GIF by using additional options such as "bilinear", "nearest", or "best". Bilinear filtering uses a bilinear interpolation algorithm to upscale the images while preserving their detail. Nearest filtering selects the nearest neighbor from among the available frames to render the current frame. Best filtering combines the strengths of both nearest and bilinear filtering to produce the best possible results.