To convert an existing JPEG, GIF or PNG into a WebP or AVIF file, you need to use the thumb method.
You can also set the default format option in your config file and convert all images unless you override the format option in the thumb method.
This is only recommended if you really find yourself converting 90% of your files to that format anyway. Otherwise you will need to override the default quite a lot.
The format option can also be used in srcset definitions.
The GDLib/SimpleImage driver currently only supports
webp, ImageMagick supports
Be aware that not all browsers support the new formats yet.