# Add Images

This function block combines two images by adding their pixel values together. It is a simple, fast way to merge brightness or overlay image contents, useful when you want a direct sum of two images rather than a blended average.

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

`Image Any` First input image to be added.

`Image Any` Second input image to be added.

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

`Image Any` Resulting image after pixel-wise addition (values kept within valid display range).

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

This block has no interactive controls.

## ⚙️ Running mechanism <a href="#how-it-works" id="how-it-works"></a>

* The block reads the two provided images and produces a new image by combining pixel values from both inputs on a per-pixel basis.
* Resulting pixel values are kept inside the valid display range so the output remains viewable.
* For best results, both input images should have the same resolution and number of channels (e.g., both RGB or both grayscale). If they differ, prepare images first (see Tips and Tricks).

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

* Very fast pixel-wise combination — useful for simple overlays, brightness accumulation, or merging visual layers.
* Produces a single image output that can be viewed or further processed by other blocks.
* Works with any image format supported by the system as long as the inputs are compatible.

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

1. Connect the first image source to the first `Image Any` input.
2. Connect the second image source to the second `Image Any` input.
3. Read the combined image from the `Image Any` output and forward it to display, analysis, or saving blocks.

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

* If you want a weighted blend instead of a straight sum, use the Add Images Weighted block.
* If inputs have different sizes, use Image Resizer or Image Resize to match their dimensions before adding. Image Padding can also be used to align images without scaling.
* To avoid loss of detail from bright regions saturating (clipping), try Normalize Image or Contrast Optimization after adding.
* Use Blur or Denoising on inputs before adding if input noise causes unwanted artifacts.
* If channels differ (e.g., one is grayscale, the other RGB), use Split Image / Merge Channels to convert or adapt channels to match.
* Preview results with Show Image and save outputs using Image Logger or Image Write for record-keeping.

## 🛠️ Common issues & remedies <a href="#common-issues" id="common-issues"></a>

* Problem: Output appears overexposed or clipped.\
  Remedy: Use Add Images Weighted to control contribution of each image, or run Normalize Image / Contrast Optimization on the result.
* Problem: Inputs have different sizes or aspect ratios.\
  Remedy: Match sizes with Image Resizer or Image Resize before connecting to this block.
* Problem: Channel mismatch (RGB vs grayscale).\
  Remedy: Convert channels using Split Image and Merge Channels, or ensure both sources provide the same channel format.
* Problem: Unexpected noise or artifacts after addition.\
  Remedy: Apply Blur or Denoising to inputs before adding; consider adjusting exposure on source images with camera settings or preprocessing.

Use this block when you need a straightforward pixel-wise sum. For more controlled blending or to avoid saturation, consider Add Images Weighted or a normalization/contrast step in the processing chain.


---

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