All Products
Search
Document Center

CDN:Adjust image quality

Last Updated:Jan 08, 2024

You can adjust the quality of an image by automatically compressing the image, changing the absolute quality value, and changing the quality coefficient. You can adjust the image quality to reduce the file size and traffic costs.

Note
  • The image editing feature of Alibaba Cloud CDN, the image editing feature of Dynamic Content Delivery Network (DCDN), and the Image Processing (IMG) feature of Object Storage Service (OSS) are three different features.

  • Image editing is a paid service and is free of charge until further notice.

  • Quality transformation applies only to JPG and WebP images.

Automatic compression

Automatic compression compresses images without changing the width, height, or format of the images. Therefore, automatic compression can reduce the amount of data transfer. For more information, see Enable and use image editing.

Image quality adjustment parameters

Parameters

Set the action to quality.

The following table describes the parameters.

Parameter

Description

Valid value

Q

The absolute quality value of the image. Image quality can be represented by an absolute value. You cannot adjust the image quality to a higher value.

The value must be a multiple of 5 between 0 and 100. Other values are not supported.

Note

A greater quality value specifies higher quality and higher clarity. We recommend that you set Q to 95.

q

The quality coefficient of the image. Image quality can be adjusted based on the original quality and a quality coefficient.

The value must be a multiple of 5 between 0 and 100. Other values are not supported.

Note

A greater quality value specifies higher quality and higher clarity. We recommend that you set Q to 95.

Examples

  • A request URL that changes the absolute quality value is http(s)://example.com/image01.png?image_process=quality,Q_90. If the current quality value is 95, the quality value of the converted image is 90. If the current quality value is 80, the quality value of the converted image is still 80.

  • A request URL that changes the quality coefficient is http(s)://example.com/image01.png?image_process=quality,q_90. If the current quality value is 80, the quality value of the converted image is 80 × 90% = 72.