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

Image Any First image input to be blended.

Image Any Second image input to be blended.

πŸ“€ Outputs

Image Any Resulting blended image.

πŸ•ΉοΈ Controls

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

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

  • 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

  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

  • 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

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

Last updated

Was this helpful?