I would like to host my images in a special CDN server which could server images with preprocessing. For example images loaded by clients may be in jpeg, png or gif format, they may present the images at a different resolution in the final document, and when the document is viewed the images will be served in webp format and exactly at the resolution set on the final documents.
so the original images loaded is as it is on the server but the image served is in webp format and in the size required for the final document.