# Multiply Images

This function block performs a pixel-wise multiplication of two input images and outputs the resulting image. It is useful for masking, combining exposures, or applying per-pixel weight maps.

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

`Image` First image to multiply.\
`Image` Second image to multiply.\
(Inputs are read in order — first input is multiplied by second input.)

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

`Image` Resulting image after per-pixel multiplication.

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

This block has no adjustable controls. The operation runs automatically when input images are provided.

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

* The block accepts two images, compares them, and produces a new image where each output pixel is the product of the corresponding pixels from the two inputs.
* Both input images must match in size. If they differ, the block will report an error and will not produce a valid output. Use an image resizer before this block when needed.
* Typical uses include applying masks, combining per-pixel weights, or multiplying channels for specialized effects.

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

* Simple and fast per-pixel multiplication of two images.
* Works with any image format accepted by the system (color or grayscale), provided both inputs share the same dimensions.
* Produces a single image output ready for further processing or visualization.

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

1. Connect the image you want to modify to the first `Image` input.
2. Connect the second `Image` (mask, weight map, or second image) to the second `Image` input.
3. Ensure both images have the same width and height. If they do not, add an image resizing step before this block.
4. The block outputs the multiplied image on the `Image` output for visualization or further processing.

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

* If images have different sizes, insert `Image Resize` (or `Image Resizer`) before this block to match dimensions.
* To avoid unexpected brightness/overflow, consider preparing inputs with `Normalize Image` or scale one input using `Divide Images` before multiplication.
* For blending or weighted combinations, try combining this block with `Add Images` or `Add Images Weighted` depending on the desired effect.
* Use `Apply Mask` to create a binary mask image and multiply it with a source image to quickly mask out regions.
* Preview results with `Show Image` and save results using `Image Write` or `Image Logger` for logging/export.

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

* Error about mismatched image sizes: ensure both inputs have identical width and height; use `Image Resize` to fix this.
* Unexpected brightness or clipping: normalize or scale inputs before multiplication (see `Normalize Image` and `Divide Images`).
* No output appears: verify that both input connections are providing valid image data and that the block is receiving active input.


---

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