COS uses the imageMogr2 API provided by CI to adjust the quality of an image.
- Image Processing is a paid service, the fees of which are charged by Cloud Infinite. For detailed billing instructions, see Cloud Infinite’s Billing and Pricing.
- This API applies only to images in JPG or WebP formats.
download_url?imageMogr2/quality/<Quality> /rquality/<quality> /lquality/<quality>
|download_url||URL of the input image, formatted as
|/quality/&dxlt;Quality>||Absolute quality of the image. Value range: 0−100. Default value: quality of the input image. The smaller value between the input image quality and the specified quality is used. If there is an exclamation mark (!) after
|/rquality/&dxlt;quality>||Relative quality of the image, relative to that of the input image. Value range: 0−100. For example, if the input image quality is 80 and
|/lquality/&dxlt;quality>||The lowest quality of the output image. Value range: 0−100.
|/ignore-error/1||If this parameter is carried and the image failed to be processed because it is too large, the input image will be returned with no error reported.|
Sample request 1: setting absolute quality
This example sets the absolute quality of an image to
Sample request 2: setting relative quality
This example sets the relative quality of an image to
Sample request 3: setting relative quality with a signature carried
This example processes the image in the same way as in the example above except that a signature is added. The signature is joined with other processing parameters using an ampersand (&):
You can obtain the value of
<signature>by referring to Request Signature.