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.
A Chinese Cloud service provider Qiniu.com provides such services . They provide an API called imageMogr2 and with this API installed and the images hosted on their special servers can be pulled in any format, any size with other alterations.
If any one find similar services with AMAZON or other service providers will be glad to know more.
Their API documentations are available at developer.qiniu.com, but I am still relectuant to host on Chinese servers due to the great fire wall and access issues to the outside world.