Quality Transformation
Updated at:2025-11-03
Overview
Adjust the quality of image encoding.
Quality settings only apply to lossy compressed image formats such as JPEG, WebP, and HEIC. For losslessly compressed formats like PNG, TIFF, BMP, and GIF, the quality setting will have no effect.
Quality parameters
Command name: quality.
| Parameters | Value | Description |
|---|---|---|
| q | 1-100 | Set the relative quality of the image. If the original image quality is N, the resulting quality will be N * q%. |
| Q | 1-100 | Set the absolute quality of the image. If the original image quality is N, the resulting quality will be Q. |
| c | le, ge, any | Define the conditions for applying the absolute quality Q to the image. If the original quality is N: "le" applies when Q<N, "ge" applies when Q>N, and "any" applies under all conditions. The default is "le". |
Note:
- The quality of different image formats is not comparable. For example, a JPEG quality of 75 and a WebP quality of 75 have no comparability in terms of image quality or file size;
- A higher quality parameter results in better image quality, but the image size will also increase. It is recommended to choose a quality that balances image quality and size: 75 for JPEG, 75 for WebP, and 45 for Heic;
- The parameter
Qcombined withc_gecan improve the encoding quality of the image, but this will only enhance the image quality in the case of thumbnails; it will not enhance the image quality when no thumbnail is generated;
Example
- Set the image quality to 80% of the current quality:
https://doc.bce.baidu.com/bce-documentation/BOS/image.jpg?x-bce-process=image/quality,q_80
- Set the image quality to 80:
https://doc.bce.baidu.com/bce-documentation/BOS/image.jpg?x-bce-process=image/quality,Q_80
