In this section, we will focus on how to compress your image a different format using the optional_parameters in the Cloudimage URL. By default, the generated image has the same format and compression as the origin image. You can decide to override the default format as documented below.
You can change the output format by using one of the values descibed below:
|tpng||PNG||output a image/png image|
|tgif||GIF||output a image/gif image|
|tjpg||JPG||output a image/jpeg image|
|twebp||WebP||output a image/webp image -- only supported by some browsers, mainly Chrome.|
If you want to enable WebP by default on all images processed by Cloudimage, please contact us. By enabling WebP bydefault, images will be delivered as WebP to Chrome or WebP-compatible clients, and JPEG will be delivered to other clients.
|q[1..100]||JPG quality index, between 1 and 100 (example: q95)|
|i1||Sets JPG interlacing mode|
|png-lossy-[q]||Define PNG quality and if lossy PNG can be used. (example: png-lossy-30)|
|png-lossless||Force PNG as lossless. This is currently the default value. (example: png-lossless)|
|webp-lossy-[q]||Define WEBP as lossy, and set its quality|
|webp-lossless-[q]||Define WEBP as lossless, and set its compression quality|
Note that you can only see these images on a webp-compatible browser such as Chrome.
In some cases, you want to finetune the compression of some specific images such as logos. You can totally combine PNG and WEBP options to create options patterns such as :
webp-lossy-21.png-lossy-30 which will deliver a WEBP with quality 21 on webp-compatible browsers, and a lossy PNG with quality 30 for other browsers.
Do not hesitate to contact us in case you need more compression options.