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.
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. It is free of charge until further notice.
The image processing feature is in private review. To use this feature, submit a ticket.
Automatic compression
Only JPG and WebP images can be automatically compressed. This feature compresses images while retaining the width, height, and format of the images, thereby reducing the data transfer volume. You can enable automatic compression by following instructions in Enable image processing.
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.