Dynamic Route for CDN (DCDN) can automatically convert image formats to WebP or covert images to a specified format. You can convert images that are stored on DCDN nodes to a specified format. This topic describes how to convert image formats and provides examples.

Note
  • To use image editing, you must first submit a ticket to activate this feature.
  • Image editing is a paid service. It is currently free of charge until further notice.

Automatically convert images to WebP

DCDN determines whether to convert images to the WebP format based on the Accept header in a request. If image/webp is included in the Accept header, DCDN automatically converts images to the WebP format.

The Accept header used in this topic is for reference only. The actual Accept header shall prevail. In the following example, image/webp is included in the Accept header. This indicates that Alibaba Cloud CDN automatically converts images to the WebP format.
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9

Convert images to specified formats

Parameters

Set the action to format.

The following table describes the formats to which images can be converted.
Supported format Description
JPEG Converts base images to the JPG or JPEG format.
PNG Converts base images to the PNG format.
WEBP Converts base images to the WebP format.
BMP Converts base images to the BMP format.
GIF Converts base images to the TIFF format.
Note GIF images are animated. If you convert a GIF image to another format, the image is no longer animated and becomes static.
TIFF Converts base images to the TIFF format.
JPEG 2000 Converts base images to the JPEG 2000 format. The suffix of the names of JPEG 2000 images is JP2.
Examples
image_process=format,bmp