# Collage Images

This function block creates a single collage image from multiple input images. If a matching flag list (OK/NOK) is provided, the collage adds colored borders to each tile to indicate status.

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

* `Image List` A list of images to be combined into the collage (can be images of different sizes).
* `Flag List` Optional list of boolean or status flags (OK/NOK) matching each image in the `Image List`. When provided, tiles show a border color indicating the flag state.

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

* `Collaged Image` The resulting combined image created from the input list.

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

* `Select Image Size (Pixel)` Use this slider to set the tile size used in the collage layout. Larger values produce bigger tiles and a larger final collage image.

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

* Easy merging of many images into a single preview image suitable for reports, dashboards, or quick inspection.
* Optional flagging support to visually mark each tile as OK or NOK using borders.
* Adjustable tile size so you can balance detail and final collage dimensions.
* Accepts mixed image sources (camera frames, processed crops, saved images).

## ⚙️ Running mechanism <a href="#how-it-works" id="how-it-works"></a>

When executed, the block reads the provided `Image List` and optionally the `Flag List`. It resizes or tiles images according to the chosen `Select Image Size (Pixel)` and lays them out into a grid. If flags are present and match the image count, each tile receives a border color that indicates its OK/NOK state. The final combined image is emitted from the `Collaged Image` output.

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

1. Prepare the images you want combined and provide them to the `Image List` input.
2. Optionally provide a corresponding `Flag List` of equal length to add status borders.
3. Adjust `Select Image Size (Pixel)` to change tile size for readability or compactness.
4. Connect the `Collaged Image` output to a display or save block to inspect or store the result.

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

* Normalize input sizes for better-looking collages: use `Image Resize` or `Image Resizer` before feeding images into `Image List`.
* If you want to collect multiple cropped regions from a single source, use `Image ROI Select Multi` to build your `Image List`.
* Generate flags automatically by combining detection blocks such as `Mask Detection`, `Object Detection`, or `Object Detection - Custom`. Use detection results (OK/NOK logic) to build the `Flag List` for visual inspection.
* Preview the final collage interactively by connecting the output to `Show Image`.
* Save collages automatically using `Multi Image Write` or log them with `Image Logger` for traceability.
* When using many images, reduce `Select Image Size (Pixel)` to keep the final collage within display or file size limits.

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

* If borders appear missing or incorrect, confirm the `Flag List` length equals the `Image List` length.
* If images look stretched or cropped unexpectedly, add an `Image Resize` step to standardize aspect ratios before creating the collage.
* If the collage is too large for display or saving, lower the `Select Image Size (Pixel)` value.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.augelab.com/function-blocks/image-transformations/operations/collage-images.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
