Cloudimage - Documentation

Accounts created before Nov. 1st, 2021

Accounts created before November 1, 2021 have to include /v7/ in the path, like shown below.

//token.cloudimg.io/v7/original_image_url?operations&filters

Accounts created on or after November 1, 2021 do not require /v7/ and documentation have been updated accordingly.
To verify the type of configuration on your Cloudimage account, log in to your Cloudimage admin panel and look at the syntax provided on the Welcome page.

[NOTE] If you are an existing Cloudimage customer and wish to be able to remove the v7 from your URL syntax, please contact our support.

Image formats

JPEG compression

JPEG compression is suitable for delivering photographic images with minimal quality loss and high compression rate. You can either choose the compression factor yourself or use Optipress - our Machine Learning-based algorithm, which will find the most optimal compression to reduce JPEG file size while minimising the perceived quality loss.

filter
force formatforce_format=jpegforces using the JPEG image compression.
qualityq=X
X = 1..100
the smaller the value of q, the more your image will be compressed. Careful—the quality of the image will decrease as well.
optipressoptipress=X
X = 1..3
chooses the best compression approach maintaining visual quality via the Optipress algorithm.

Original image

//sample.li/woman_dress.jpg

filter valuefile size
none330 KB

Compressed with JPEG

/sample.li/woman_dress.jpg?force_format=jpeg&q=90

filter valuefile size
q=90282 KB
q=80141 KB
q=75125 KB

The JPEG compression does not support transparency. For alpha channel support, use WebP or PNG instead.

PNG format

This format is a good choice for non-photographic images - flowcharts, graphs, screenshots, logos, etc. PNG also supports transparency.

filtersyntax
force formatforce_format=pngforces using the PNG image format.

PNG example

/sample.li/Cloudimage-logo-h.png?w=800&force_format=png

Photo alt \#responsive

WebP

WebP is an image format maintained by Google and supported in most modern browsers which provides more aggressive compression techniques as JPG without noticeable quality degradation.

By default, automatic WebP delivery is switched off. When activated from the settings console, all images are delivered as WebP. If the client's browser does not support this format, JPEG or PNG (if image has alpha channel) is used instead.

You can force delivering your image in WebP by using following filters:

filtersyntaxdecription
force formatforce_format=webpforces using the WebP image format.
qualityq=X
X = 0..100
the smaller the value of q, the more your image will be compressed. Careful—the quality of the image will decrease as well.

Original image, 538 KB

//sample.li/boat.jpg

Force WebP format, 263 KB

/sample.li/boat.jpg?force_format=webp

Please note that if you force WebP (using force_format=webp) compression and the client/browser does not support WebP, the image will not be displayed. To avoid this, you can provide a fallback format if WebP is not supported: force_format=webp,jpeg. This way, the image will be served as JPEG when WebP is not supported.

AVIF

The AVIF image file format by the Alliance for Open Media is a recent image format providing optimized images with high quality. Currently supported by most versions of Chrome, Firefox, and Opera.

Please note that to increase delivery performance, AVIF images are created asynchronously and another format will be returned on the first request (WebP/JPG/PNG, depending on token settings and browser support). Once the AVIF image generation is complete, the image will be replaced with the new one.

filtersyntaxdescription
force formatforce_format=avifforces using AVIF image format.
qualityq=X
X = 1..100
the parameter is optimized to achive similar visual quality to JPEG compression with the respective values

Deliver images in original format

By default, Cloudimage delivers the images as WebP, when the format is supported by the browser. If you would like to keep the format of the original image, you can use force_format=original.

Original image

/sample.li/boat.jpg?w=400

Here, the original image is JPEG and by default, the resized version is delivered as WebP, if possible.

Force using original format

/sample.li/boat.jpg?w=400&force_format=original

Now, the processed image is forced to keep its original format.