Rounded Corner Cropping
You can edit code on OBS Console or make an API call to round corners of an image.
This operation allows you to cut off the corners of an image based on the specified radiuses. You can configure the radius of image corners to round in two ways. For details, see Table 1.
This operation is represented by rounded-corners.
Parameter |
Value Description |
Code Example |
---|---|---|
r |
It indicates both horizontal and vertical radiuses of image corners you will round. You can configure it by using the number of pixels (for example, 200) or the percentage (for example, 25p). The number of pixels ranges from 1 to 4096. If this number is greater than half of the original image's short side, the half of the short side is applied. The percentage ranges from 1p to 50p. r cannot be used together with rx or ry. |
image/rounded-corners,r_100 |
rx |
It indicates the horizontal radius of image corners you will round. You can configure it by using the number of pixels (for example, 200) or the percentage (for example, 25p). The number of pixels ranges from 1 to 4096. If this number is greater than half of the original image's short side, the half of the short side is applied. The percentage ranges from 1p to 50p. rx must be used together with ry. |
image/rounded-corners,rx_100,ry_200 |
ry |
It indicates the vertical radius of image corners you will round. You can configure it by using the number of pixels (for example, 200) or the percentage (for example, 25p). The number of pixels ranges from 1 to 4096. If this number is greater than half of the original image's short side, the half of the short side is applied. The percentage ranges from 1p to 50p. ry must be used together with rx. |
If the output image format is JPG, the cut-out corner area is white. If the output image format is PNG, WebP, or BMP, the cut-out corner area is transparent. You are advised to save rounded corner images in PNG.
Examples
- Round the corners of image example.jpg based on the horizontal and vertical radiuses of 100 and save the new image as PNG.
- Round the corners of image example.jpg based a horizontal radius of 100 and a vertical radius of 200.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot