If an image is too large or displays incorrectly on certain platforms, use format conversion to convert it to the WebP format or to a specified format.
CDN image editing, DCDN image editing, and Object Storage Service (OSS) Image Processing (IMG) are three separate features. Image editing is free of charge until further notice.
Adaptive WebP
WebP is an image file format that supports both lossy and lossless compression. CDN supports an automatic conversion to WebP feature. When this feature is enabled, CDN checks the Accept request header. If the header contains image/webp, CDN automatically converts images in other formats to the WebP format for caching. To enable this feature, see Image processing operations.
Example
The following Accept header is an example. The actual header may vary. In this example, the header contains image/webp, which indicates support for automatic conversion to WebP.
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.9Format conversion parameters
Action: format
Value | Description |
jpeg | Converts the source image to JPEG format. |
png | Converts the source image to PNG format. |
webp | Converts the source image to WebP format. |
bmp | Converts the source image to BMP format. |
gif | Preserves the GIF format if the source image is a GIF. Otherwise, the format is unchanged. |
tiff | Converts the source image to TIFF format. |
jp2 | Converts the source image to JPEG 2000 format. The file extension is .jp2. |
Converting between formats may increase file size because different formats use different compression algorithms. For example, converting JPEG to WebP, JPEG to PNG, or PNG to WebP can produce a larger output. To reduce the output file size, set the quality parameter to lower the image quality.
Example
To convert the source image to BMP format, the image processing URL is: http(s)://example.com/image_01.png?image_process=format,bmp