# Image Color Match

This function block is used to adjust the colors of an input image to match those of a reference image. It utilizes histogram matching to achieve this, allowing for enhanced visual consistency across images.

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

`Image RGB` The input image that you want to match color with the reference.

`Reference Image` An image whose color histogram will influence the matching process. If not provided, the input image itself will be used for reference.

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

`Image Any` The output image will be a modified version of the input image, colored to closely resemble the reference image.

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

This function block does not have specific controls for user input apart from the inputs mentioned.

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

`Histogram Matching` Utilizes advanced statistical techniques to match the color distribution of the input image to that of the reference image.

`Compatibility` Works with RGB images, enhancing the visual quality by harmonizing colors.

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

1. **Connect Images**: Attach the input image to the first socket and, if available, a reference image to the second socket.
2. **Evaluate**: Run the block to perform color matching. The output will be an image that has its colors adjusted to match the reference.

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

Upon execution, this function block will output a new image that has undergone color adjustment based on the reference image.

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

<details>

<summary>Improving Color Consistency</summary>

For best results, use a reference image that closely represents the desired color palette you wish to achieve in the input image.

</details>

<details>

<summary>Multiple Adjustments</summary>

You can chain this function block after other image processing blocks like `Blur` or `Auto Contrast` to refine the input image before color adjustment.

</details>

<details>

<summary>Testing Different References</summary>

Experiment with different reference images to observe how color adjustments can vary greatly based on the histogram of the reference.

</details>

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

<details>

<summary>Dimension Mismatch Error</summary>

If you encounter an error stating that image sizes must be the same, ensure that both the input and reference images are of identical dimensions. Resize them if necessary.

</details>

<details>

<summary>No Output Image</summary>

If the output is not displaying any changes, verify that both images are properly connected and contain valid RGB data.

</details>
