# Image Color Match

This function block adjusts the color distribution of an input image to match a reference image. It is useful when you want consistent color appearance across multiple images or camera sources.

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

`Image RGB`

* The source image whose colors will be adjusted.

`Reference Image`

* Optional. The image used as the color reference. If not provided, the block will use the source image as reference.

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

`Image Any`

* The color-matched output image.

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

This function block has no interactive controls.

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

* Matches overall color distribution between two images for visually consistent results.
* Operates per color channel for finer matching.
* Returns a standard image ready for further processing or display.

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

1. Connect the source image to `Image RGB`.
2. Optionally connect a reference image to `Reference Image`. If omitted, the source will be used as reference.
3. Run the block to get the color-matched result from `Image Any`.

## 📊 Evaluation <a href="#evaluation" id="evaluation"></a>

On execution, the block compares color statistics between source and reference and produces an output image whose color distribution is aligned with the reference.

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

* Use `Image Resize` or `Image Resizer` to ensure both images have the same dimensions before feeding them in (size mismatch will produce an error).
* Use `Color Space` or `Split Image` and `Merge Channels` when you want to match specific channels or convert between color representations before/after matching.
* Use `Adjust Colors` or `Normalize Image` to tweak contrast or white balance either before matching (to stabilize input) or after matching (for final visual tuning).
* Preview results with `Show Image` and save outcomes with `Image Write` or `Image Logger` for documentation or downstream processing.

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

* If you see an error about image sizes, make sure both images have identical width and height and use `Image Resize` to correct mismatches.
* If colors look unnatural after matching, try preprocessing with `Normalize Image` or adjusting per-channel values with `Adjust Colors` before running the block.
* For batch processing many images, consider resizing and normalizing inputs first to obtain consistent results across the set.


---

# 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/blocks-reference/image-transformations/analysis/image-color-match.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.
