CDN Rendering API
This article explains how the creoline® CDN Rendering API can be controlled. The parameters specified here are configured at runtime via the HTTP query parameters.
Prerequisites
In order to use the Rendering API, it must first be activated via our Customer Center. To do this, log in to our customer center at account.creoline.com and select the desired CDN resource for which the rendering API is to be activated. Then open the settings via the Settings tab and activate the Rendering API there.
Image manipulation can only be used for source resources up to 10 MiB and image sizes up to 4,000 x 4,000 pixels. If the source file on your target server is larger than 10 MB or exceeds the dimensions of 4,000 x 4,000 pixels, the original file will be returned.
Parameter overview
Parameter | Default value | Description |
---|---|---|
w | NULL | image width |
h | NULL | image height |
ar | 1 | Aspect Ratio Consideration |
q | NULL | Image quality (JPG, PNG, WebP) |
webp | 1 | Automatically generate WebP graphic |
avif | 1 | Automatically generate AVIF graphic |
c | default | Possible values: default (standard), gray (grayscale) |
Deactivate automatic WebP conversion
You can use the webp
parameter to deactivate the automatic conversion of WebP graphics.
# Original image
https://assets.cstatic.io/img/cdn/example-resize.jpg
# JPG graphic is not automatically converted to WebP:
https://assets.cstatic.io/img/cdn/example-resize.jpg?webp=0
Manipulation of the image size
The manipulation of the image size can be defined via the parameters w
Width and h
Height. Manipulating the image size is suitable, for example, for generating thumbnails on preview pages without having to generate additional thumbnails.
# Original image
https://assets.cstatic.io/img/cdn/example-resize.jpg
# Image size reduced to: 250x250
https://assets.cstatic.io/img/cdn/example-resize.jpg?w=250
In this example, the image is rendered to the size of 250px * 250px
, whereby the resizing in the default setting takes the aspect ratio into account.
The ar
aspect ratio parameter can be used to generate images regardless of the actual aspect ratio.
Attention: By deactivating the aspect ratio consideration, graphics can be manipulated unintentionally.
Example:
# Original image
https://assets.cstatic.io/img/cdn/example-resize.jpg
# Image size reduced to: 250x350
https://assets.cstatic.io/img/cdn/example-resize.jpg?w=250&h=350&ar=0
Manipulation of the image quality
The quality of the image can be influenced independently of the CDN setting via the HTTP query parameter q
. There are different parameters depending on the image type.
Image quality for JPG, AVIF and WebP graphics:
Parameter | Value | Quality |
---|---|---|
q | 20 | Low |
q | 40 | Medium |
q | 60 | Good |
q | 80 | Very good (recommended) |
q | 100 | Original |
Image compression for PNG graphics:
Parameter | Value | Quality |
---|---|---|
q | 6 | Medium |
q | 7 | Good |
q | 8 | Very good |
q | 9 | Maximum (recommended) |
In the settings of your CDN resource, the settings per image type can be defined globally so that the quality specification in the URL is not required. To do this, you can define the quality of the image types in the Customer Center under CDN → Settings.