Littlegolden we currently use the Intervention PHP library to resize images, and a choice had to be made for the output format. As far as I'm aware there's no built-in method to automatically use the most efficient format for output.
We'd have to try exporting to multiple formats and compare the file size. Not sure if we want to add that in core. An extension could add it.