Indexcropping
Code editing and API calling are the only two methods supported.
Set the top left corner of the image as the starting point. Set x-axis overlapping with the width, and y-axis overlapping with the height. Crop the image into several consecutive partitions horizontally or vertically, each having equal width or height. Get the partition you want according to the index. For details, see Table 1.
Operation name: indexcrop
| Parameter | Value Description | Code Example |
|---|---|---|
| x | Width of each partition after horizontal cropping, ranging [1, original width of the image]. x and y cannot be chosen at the same time. | image/indexcrop,x_1000,i_0 |
| y | Height of each partition after vertical cropping, ranging [1, original height of the image]. x and y cannot be chosen at the same time. | |
| i | If there are n partitions in total, i ranges [0, n-1]. When i = 0, you obtain the first partition. If you set a value larger than n-1, the original image will be returned. |
Example
- Indexcrop the image horizontally. The width of each partition is 1000. Choose the first partition.
https://e-share.obs.cn-north-1.myhuaweicloud.com/example.jpg?x-image-process=image/indexcrop,x_1000,i_0

- Indexcrop the image horizontally. The width of each partition is 600. Choose the first partition.
https://e-share.obs.cn-north-1.myhuaweicloud.com/example.jpg?x-image-process=image/indexcrop,x_600,i_0

Last Article: Inscribed Circle
Next Article: Rounded Corner Cropping
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.