Index Crop
Updated at:2025-11-03
Overview
This document explains how to crop indexes of images.
Index cropping parameters
Action name: indexcrop
| Parameters | Value | Description |
|---|---|---|
| x | 1-4096 | The x and y parameters cannot be specified simultaneously; one must be provided. For vertical cropping, specify the cropping width. If the specified width exceeds the image's width, the image's width will be used by default. |
| y | 1-4096 | The x and y parameters cannot be specified simultaneously; one must be provided. For horizontal cropping, specify the cropping height. If the specified height exceeds the image's height, the image's height will be used by default. |
| i | 0-65536 | Define the i-th cropped area to be used after cropping. If the specified area exceeds the available cropped regions, the original image will be returned. If not specified, the default value is 0. |
Example
- Crop the image horizontally with a height of 50, and select the 1st and 2nd cropped areas.
https://doc.bce.baidu.com/bce-documentation/BOS/image.jpg?x-bce-process=image/indexcrop,y_50,i_0
https://doc.bce.baidu.com/bce-documentation/BOS/image.jpg?x-bce-process=image/indexcrop,y_50,i_1
- Crop the image vertically with a width of 100, and select the 1st and 2nd cropped areas.
https://doc.bce.baidu.com/bce-documentation/BOS/image.jpg?x-bce-process=image/indexcrop,x_100,i_0
https://doc.bce.baidu.com/bce-documentation/BOS/image.jpg?x-bce-process=image/indexcrop,x_100,i_1
