Help & Knowledgebase

Image compression

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.


Output Format

You can change the output format by using one of the values descibed below:

Value Format Description
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.
An example:

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.

JPEG Specific Options

Value Description
q[1..100] JPG quality index, between 1 and 100 (example: q95)
i1 Sets JPG interlacing mode

PNG Specific Options

Value Description
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)


Value Filesize Result Link
png-lossy-20 ~ 1KB
png-lossy-80 ~ 2KB
png-lossless ~ 4KB

WEBP Specific Options

Value Description
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.

Value Filesize Result Link
webp-lossy-20 ~ 1KB
webp-lossy-80 ~ 2KB

Combine options

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.

Need more compression options ?

Do not hesitate to contact us in case you need more compression options.