Convert images as they are uploaded to a server?

Does anyone know if images can be converted at the server-level? We have hundreds of thousands of images – mostly in jpeg format. My question is: can the images (that are uploaded to our Amazon server) be converted there and then? The format I am interested in using would be something like Webp – so the conversion would be JPEG > WEBP