# Subtract Images

This function block is designed to perform subtraction between two images. It calculates the pixel-wise difference between an "Actual Image" and a "Reference Image" to produce a "Difference Image".

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

`Actual Image` The primary image from which the reference image will be subtracted.

`Reference Image` The secondary image that will be subtracted from the actual image.

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

`Difference Image` The result of the pixel-wise subtraction between the actual and reference images.

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

`Pixel-wise Subtraction` The block computes the difference for each pixel, allowing you to analyze the variations between two images.

`Error Handling` If the input images do not have the same dimensions, the block raises an error to notify the user.

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

No specific controls are needed as inputs will be handled directly through the connected image blocks.

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

1. **Connect Images**: Link the desired images to the corresponding inputs: connect the actual image to `Actual Image` and the reference image to `Reference Image`.
2. **Evaluate the Block**: Run the block to compute the difference. The output will show the resulting difference image.

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

When evaluated, this function block returns the difference image that highlights areas of difference between the actual and reference images.

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

<details>

<summary>Ensuring Same Dimensions</summary>

It's critical to ensure that both input images are of the same dimensions. You can use the `Image Resize` function block to adjust one of the images as necessary.

</details>

<details>

<summary>Visualizing Differences</summary>

After getting the result from the `Subtract Images` block, consider combining or overlaying the difference image with the original images using `Add Images` or `Multiply Images` blocks for easier visualization of the changes.

</details>

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

<details>

<summary>Dimension Mismatch Error</summary>

If you encounter an error indicating that the two images need to be of the same size, verify the dimensions of both images and adjust using the `Image Resize` function block.

</details>
