> For the complete documentation index, see [llms.txt](https://docs.augelab.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.augelab.com/function-blocks/blocks-reference/image-transformations/operations/slice-image.md).

# Slice Image

This function block splits an input image into a grid of smaller sub-images. Use it to break large images into tiles for individual analysis, parallel processing, or to generate image galleries.

## 📥 Inputs <a href="#inputs" id="inputs"></a>

`Image Any` - Main image to be sliced.

`Horizontal Percentage` - Number of horizontal slices (columns). If empty, defaults to 1.

`Vertical Percentage` - Number of vertical slices (rows). If empty, defaults to 1.

## 📤 Outputs <a href="#outputs" id="outputs"></a>

`Image Any` - The main image with optional visual hints (same as input or annotated version).

`Sliced Images` - List of the generated sub-images (each tile from the grid).

`Sliced Coordinates` - List of rectangle coordinates for each slice (useful to map results back to the original image).

## 🕹️ Controls <a href="#controls" id="controls"></a>

This block uses the above inputs as its adjustable parameters. Provide values for `Horizontal Percentage` and `Vertical Percentage` to control the grid layout.

## ⚙️ Running mechanism <a href="#running-mechanism" id="running-mechanism"></a>

* When evaluated, the block reads the provided `Image Any` and the two slice number inputs.
* It divides the image into a grid using the specified number of columns and rows.
* The block outputs the full image, a list of individual slice images (in reading order), and the coordinates for each slice so you can relate detections back to the original image.

## ✨ Features <a href="#features" id="features"></a>

* Easy grid-based slicing without needing manual cropping.
* Returns both slice images and their coordinates for downstream processing.
* Works with any image size; slices are computed to evenly cover the image area.

## 📝 Usage instructions <a href="#usage" id="usage"></a>

1. Connect an image producer (camera, file loader, etc.) to `Image Any`.
2. Set the desired number of columns via `Horizontal Percentage`.
3. Set the desired number of rows via `Vertical Percentage`.
4. Run the scenario: the block will output the tiled images and their coordinates for further processing.

## 💡 Tips and Tricks <a href="#tips-and-tricks" id="tips-and-tricks"></a>

* Combine with `Show Image` to preview individual tiles quickly by connecting one element from `Sliced Images` into a display workflow.
* Use `Image Resize` or `Image Resizer` before slicing if you need uniform tile sizes or want to reduce processing time.
* Feed each tile into detection blocks such as `Find Object`, `Object Detection`, or `Mask Detection` to run per-tile analysis and then use `Sliced Coordinates` to map results back to the original image.
* After per-tile processing, use `Collage Images` or `Image Concatenate` to create a single visual summary from the processed tiles.
* To save results per tile, connect `Sliced Images` to `Image Logger` or `Multi Image Write` for organized export.

(hint) If you only need a single region instead of a grid, consider using `Image ROI Select` or `Image ROI` before slicing to limit the area.

## 🛠️ Troubleshooting <a href="#troubleshooting" id="troubleshooting"></a>

* If tiles appear stretched or unexpected, try adding `Image Resize` before the block to enforce consistent source dimensions.
* If you receive fewer tiles than expected, check that `Horizontal Percentage` and `Vertical Percentage` are set to integers greater than 0.
* If downstream detectors miss objects at tile borders, add a small overlap by resizing or pre-cropping with `Image ROI` and then slicing, so objects crossing boundaries are captured in at least one tile.
