Output
Caravaggio can return your image in another format. You my want to transform a png
image into a
progressive jpeg
.
Caravaggio supports original
, auto
, jpeg
, png
webp
and tiff
.
Example
https://caravaggio.now.sh/o:png/?image=https://cvg-res.now.sh/girls.jpeg
https://caravaggio.now.sh/o:webp/?image=https://cvg-res.now.sh/girls.jpeg
If you specify nothing or you enter o:original
, the same format as the input image will be returned.
Auto
auto
is a special value, With this Caravaggio will try to understand the best output format depending
on the browser request. Usually, if the browser supports it, the result will be in webp
. Note that
the result won't be cached because the same request, with a different browser, can return a different result.
Notes
If you installed caravaggio through the global npm module, you may need to ensure your version of libvips
supports the image formats you need. See the sharp documentation about this.