Raw image formats are the highest quality but have unreasonably large file sizes of up to hundreds of megabytes.
For web images, the WebP file format offers 25-35% smaller file sizes than JPEG for the same quality photos, meaning you can upload higher quality images for the same disk space and speed up your site.
HEIF is another JPEG alternative with more efficient compression but isn’t currently supported by any major browsers.
PNG files offer lossless compression, but that means the file sizes will be exceedingly large and slow to load. A single PNG file can often be hundreds of KB or even 1MB+. However, if you take advantage of some tactics like lazy loading (available in core since WordPress 5.5) and a CDN, you could still have a fast site.