All Products
Search
Document Center

CDN:Convert image formats

Last Updated:Apr 01, 2026

The image editing feature of Alibaba Cloud CDN lets you serve images in a different format without modifying the source file. Two approaches are available: automatically convert images to WebP based on browser support, or specify the output format explicitly using a URL parameter.

Note

The image editing feature of Alibaba Cloud CDN, the image editing feature of Dynamic Route for CDN (DCDN), and the Image Processing (IMG) feature of Object Storage Service (OSS) are separate features and cannot be used interchangeably. Image editing is free of charge until further notice.

Important

Converting between formats — for example, JPEG to WebP or PNG to WebP — may produce a larger file than the source image, because different formats use different compression algorithms. To reduce image size after conversion, set the quality parameter.

Automatic conversion to WebP

WebP supports both lossy and lossless compression. When automatic WebP conversion is enabled, Alibaba Cloud CDN inspects the Accept header of each request. If the header includes image/webp, the image is converted to WebP and cached. If the header does not include image/webp, the image is served in its original format.

For setup instructions, see Enable and use image editing.

Important

Enabling automatic WebP conversion temporarily reduces your cache hit ratio. The ratio recovers automatically after a short period. Do not enable this feature during peak hours.

Example Accept header

The following header tells CDN to serve WebP when available. The actual header sent by the browser may differ.

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

Format conversion parameter

To convert a base image to a specific format, add the image_process=format,<value> query parameter to the image URL.

Syntax

http(s)://<domain>/<image>?image_process=format,<value>

Supported output formats

ValueDescription
jpegConverts base images into the JPG or JPEG format.
pngConverts base images into the PNG format.
webpConverts base images into the WebP format.
bmpConverts base images into the BMP format.
gifSaves source images in the GIF format. If source images are not in the GIF format, they are saved in the original format.
tiffConverts base images into the TIFF format.
jpeg 2000Converts base images into the JPEG 2000 format. The suffix of a JPEG 2000 image name is JP2.

Example

To convert an image to BMP:

http(s)://example.com/image_01.png?image_process=format,bmp

To reduce image size after format conversion, configure the quality parameter.

What's next