Indexed slice
The indexed slice operation divides an image into segments of a specified length along the x-axis or y-axis. You can then extract a specific area by specifying an index.
Parameters
Parameter | Description | Value |
ic | Format:
The `x` indicates a horizontal slice along the x-axis. The `y` indicates a vertical slice along the y-axis. | length: An integer in the range of [1, length of the sliced edge]. The unit is px. index: An integer in the range of [0, maximum number of segments). The value 0 indicates the first segment. The maximum number of segments is automatically calculated based on the slicing rule. Note If the value is out of range, the original image is returned. |
Usage notes
If the specified index exceeds the number of available segments, the original image is returned.
Examples
Divide the image into 100 equal sections along the x-axis and extract the first section.
https://oss-console-img-demo-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/example.jpg@100x-0ic

Slice the image vertically into 100 pixel segments and extract the first segment (index 0).
https://oss-console-img-demo-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/example.jpg@100y-0ic

Slice the image horizontally into 100 pixel segments and attempt to extract the 101st segment. Because the index is out of range, the original image is returned.
https://oss-console-img-demo-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/example.jpg@100x-100ic
