Image processing
You can enable features like automatic conversion to WebP, automatic rotation (auto-orientation only), and automatic compression directly in the Alibaba Cloud CDN console. For more advanced transformations, such as cropping or adding watermarks, you can add image editing parameters to the request URL.
-
The image editing features of Alibaba Cloud CDN, DCDN, and OSS are independent and cannot be used interchangeably.
-
Image editing is a paid service. During the public preview, this feature is available free of charge. You will be notified before billing starts.
-
When you use the image editing feature, converting between different image formats, such as from JPEG to WebP, JPEG to PNG, or PNG to WebP, may increase the file size. This is because of significant differences in their compression algorithms. If you need to reduce the file size, we recommend that you lower the image quality by using the
qualityparameter.
Enable image editing
-
Log on to the CDN console.
-
In the left navigation pane, click Domain Names.
-
On the Domain Names page, find the target domain name and click Manage in the Actions column.
-
In the domain's navigation pane, click Optimization.
-
In the Image Editing section, turn on Image Editing and select the image formats that you want to convert.
Note-
After you select the supported image formats and enable the feature, the image editing parameters in a URL take effect when you process images by using file URLs.
-
You can decide whether to enable automatic conversion to WebP, automatic rotation (auto-orientation only), and automatic compression in the console based on your business needs.

Parameter
Description
Supported Image Formats
Select the image formats to convert. This parameter is required, and you can select multiple formats.
Automatic Conversion to WebP
After you enable this feature, Alibaba Cloud CDN checks the
Acceptheader of the request. If the header containsimage/webp, images in other formats are automatically converted to the WebP format and then cached.NoteEnabling this feature may cause a temporary drop in the cache hit ratio. The ratio will return to normal after a short period. Do not enable this feature during peak business hours.
Automatic Rotation
Enables automatic orientation correction for images.
Note-
Automatic rotation applies only to images that have the
auto-orientparameter. -
Enabling this feature may cause a temporary drop in the cache hit ratio. The ratio will return to normal after a short period. Do not enable this feature during peak business hours.
Automatic Compression
When enabled (disabled by default), this feature compresses images to reduce traffic without changing their resolution, dimensions, or format.
-
0 (default): Disables the feature.
-
1 to 100: Enables the feature. For example, a value of 90 indicates that the image retains 90% of its original quality.
NoteThis feature supports only the JPEG and WebP formats.
Source Image Cache
If a source image has multiple converted versions, enabling source image cache reduces the number of origin requests.
-
-
Click OK to complete the setup.
Process images by using file URLs
-
Select the supported image formats as described in Enable image editing.
-
Add parameters to the request URL to perform custom transformations.
-
Format:
http://example.com/image_01.png?image_process=action,param_value/action,param_valueField
Description
example.com
Your accelerated domain name.
image_01.png
The name of the image.
image_process
A fixed parameter for image editing.
action,param_value
The action, parameter, and value for an image transformation. Separate multiple actions with forward slashes (/). Alibaba Cloud CDN applies transformations in the order they appear in the URL. For a list of supported parameters, see Image editing parameters.
-
Example:
http://example.com/image_01.png?image_process=resize,w_200/rotate,90/format,webp. Result: The image is first proportionally resized to 200 px in width, then rotated 90°, and finally converted to the WebP format.
-
Image editing parameters
To perform a wider range of image transformations, add parameters to the request URL. The following table lists the supported parameters.
|
Feature |
Parameter |
Description |
|
format |
Converts the image to a different format. |
|
|
quality |
Adjusts image quality. |
|
|
crop |
Crops the image to a specified size. |
|
|
resize |
Resizes an image to a specified size. Upsizing is not supported. |
|
|
Performs adaptive rotation on images with orientation parameters, or rotates an image clockwise by a specified angle. |
|
|
Adjusts the image brightness, contrast, and sharpness. |
|
|
watermark |
Adds an image or text watermark. |
|
|
info |
Retrieves image information, such as dimensions, format, and quality. |