Using Caravaggio
Caravaggio accept the input image to transform and the transformation to apply.
https://caravaggio.now.sh/rotate,v:90/o:png/?image=https://cvg-res.now.sh/landscape.jpg
In this case the image reachable at https://cvg-res.now.sh/landscape.jpg
will be rotated of 90ยฐ clockwise
and the result will be in the png
format.
In general, each transformation is expressed in the form transformationName,parameter:value
and can be separated
by the next through a slash /
If the operation accept only a parameter, it can be shortened as transformationName:value
, for example o:webp
is the same as o,value:webp
If the value is boolean, it can be omitted when true, so, for example progressive
is the same as progressive:true
.
It's easier than it sounds and you can find the documentation for each operation here on the left.
The url instead, https://cvg-res.now.sh/landscape.jpg
is simply a fully qualified address of the image to fetch and transform.
Complex urls
If the url of the image to transform contains query parameters, you must encode it.
In example, the url https://cvg-res.now.sh/landscape.jpg?user=joe
must be sent as
or at least
In javascript, to obtain this encoding, you can run
Use similar functions in the language of your choice, they are the same functions used to encode query parameters.