Quality transformation

更新时间:
复制 MD 格式

The quality transform is available for images in JPG or WebP format.

Parameters

Name

Description

Value range

q

  • Sets the relative quality of the image by compressing it to a percentage of its original quality. For example, if the original image quality is 100%, using 90q results in an image with 90% quality. If the original image quality is 80%, using 90q results in an image with 72% quality.

  • Relative compression is effective only for original images in JPG format. If the original image is in WEBP format, relative quality is the same as absolute quality.

  • When the value is lossless, WEBP images are saved in a lossless format.

1-100, lossless

Q

  • Sets the absolute quality of the image. The image is compressed to Q% quality. If the original image quality is lower than the specified value, the image is not compressed. For example, if the original image quality is 100%, using 90Q results in an image with 90% quality. If the original image quality is 95%, using 90Q also results in an image with 90% quality. If the original image quality is 80%, using 90Q does not compress the image and returns the original image with 80% quality.

  • This parameter is effective only when the output format is JPG or WEBP. It has no effect on other formats. If a transformation URL specifies both q and Q, the Q parameter takes precedence.

  • When the value is lossless, WEBP images are saved in a lossless format.

1-100, lossless

Notes

Omitting the Q or q parameter may increase the image file size. To set a fixed quality for the image, use the Q parameter. To save the image with its original quality, specify 100q.

Examples