You can round the corners of a rectangle image stored in OSS by adding rounded-corners parameters. This topic describes the parameters used to round the corners of a rectangle image and provides examples on how to round the corners of a rectangle image.

Parameters

Operation name: rounded-corners

The following table describes the parameters you can configure.

Parameter Description Valid value
r The radius at which the corners are rounded. [1,4096]

Usage notes

  • If the final format of an image is PNG, WebP, or BMP that supports alpha channels, the areas of the image outside the rounded rectangle become transparent. If the final format of the image is JPG, the areas of the image outside the rounded rectangle become white. We recommend that you save the processed image in the PNG format.
  • If the specified radius for the rounded corners is greater than the radius of the largest incircle of the source image, the radius of the largest incircle of the source image is used as the radius to round the corners. In this case, the radius at which the corners are rounded is equal to half of the smallest edge of the source image.

Examples

An image in the bucket named image-dem in the China (Hangzhou) region is used in this example. The following URL is used to access the image over the Internet: