# Divide Images

This function block performs a pixel-wise division of two images to produce a new image. It is useful for normalization, ratio measurements, defect highlighting and other image arithmetic tasks where one image is used to scale or correct another.

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

`Image Any` First image input (numerator). Provide a regular image to be divided.

`Image Any` Second image input (denominator). Provide an image with the same dimensions as the first.

Note: sockets above are inputs and both must be connected with images of matching size and channel layout.

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

`Image Any` Resulting image after pixel-wise division of the first input by the second input.

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

This block has no interactive widgets. Configure inputs upstream before evaluation.

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

* Pixel-wise division result with proper image range handling suitable for visualization or further processing.
* Direct replacement in pipelines where comparative or normalized images are required.
* Designed to work with images that share identical dimensions and channels.

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

When the block runs it takes the two connected images and computes a pixel-wise division of the first image by the second. The block expects both images to match in size and channel layout; if they do not match, the block cannot perform the operation and will require you to correct the inputs before successful evaluation.

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

* Connect the image you want to divide to the first `Image Any` input.
* Connect the image you want to divide by to the second `Image Any` input.
* Ensure both images have identical width, height and channels before running the block.
* Read the output from the `Image Any` output to continue processing or to view the result.

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

* If the two images are different sizes, use the `Image Resize` block upstream to resample one image to match the other.
* To avoid problems with zero or near-zero pixels in the denominator, add a small constant image before division. Create a small-value image with `Make Image` and combine it with the denominator using `Add Images` or `Add Images Weighted`.
* Normalize inputs first (for example with `Normalize Image`) if you expect wide dynamic range differences between the two images.
* For visualization after division, use `Auto Contrast` or `Adjust Colors` to make subtle differences more visible.
* Preview intermediate or final images with the `Show Image` block and save results using `Image Logger` or `Image Write` if needed.

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

* Mismatched image sizes: Ensure both inputs have the same dimensions. Use `Image Resize` to fix mismatches.
* Unexpected artifacts or blown-out pixels: Check for zero or very small values in the denominator and add a small constant if necessary. Also consider normalizing the inputs first.
* Strange color shifts: Confirm both images share the same channel order (e.g., BGR/RGB) and channel count. Use color conversion or channel operations upstream if needed.


---

# 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/divide-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.
