# Add Images Weighted

This function block blends two images together using a user-defined weight. It is useful for creating smooth overlays, crossfades, or controlled mixing of two visual sources.

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

`Image Any` First image input to be blended.

`Image Any` Second image input to be blended.

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

`Image Any` Resulting blended image.

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

`Weight %` Slider that sets how much influence the first image has in the blend. Lower values favor the second image, higher values favor the first image.

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

When the block runs it takes the two input images and mixes their pixel values according to the chosen `Weight %`. If the two images differ in size, the block will adjust the second image to match the first image so the blend can be performed. Final pixel values are kept within the valid image range to avoid visual artifacts.

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

* Real-time blending controlled by a single, easy-to-use slider.
* Automatic size matching when inputs differ in resolution.
* Safe value clamping to ensure valid image output.
* Works with any image-producing blocks as long as image data is provided.

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

1. Provide two image sources to the `Image Any` inputs.
2. Adjust the `Weight %` slider to set the mix ratio between the two images.
3. Read the blended image from the `Image Any` output and pass it to further processing or display.

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

* If your images are different sizes, use `Image Resizer` or `Image Resize` before this block to control how resizing is done (preserve aspect ratio, interpolation method, etc.).
* To avoid visible seams when blending images captured under different lighting, apply `Normalize Image` or `Contrast Optimization` to both inputs first.
* Use `Blur` on one input to create smooth transitions or depth-of-field style overlays.
* If you need a simple addition without weighting, consider using the `Add Images` block instead.
* Preview results with `Show Image` while tuning the `Weight %` to speed up visual adjustments.
* For combining many images, chain this block with `Add Images Weighted` repeatedly or use image concatenation blocks as an intermediate step.

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

* If output looks stretched or cropped: check that both inputs have the expected dimensions; consider inserting an `Image Resizer` to make sizes explicit.
* If result appears clipped or too bright: apply `Normalize Image` or reduce blending weight extremes.
* If no image appears: ensure upstream blocks are providing valid image data. Use a display block like `Show Image` to verify each input.
* If blending is slow with large images: reduce input size with `Image Resizer` before blending to improve performance.


---

# 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/add-images-weighted.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.
