calculator.add

Functions

add(image1, image2)

Add the two provided images element-wise.

Module Contents

calculator.add.add(image1, image2)

Add the two provided images element-wise.

Parameters:
  • image1 (Image) – The first image to be added.

  • image2 (Image) – The second image to be aded.

Returns:

A new Image object holding the sum of the provided images.

Return type:

Image

Examples

>>> from calculator import add, Image
>>> image1 = Image.from_array([[1, 2], [3, 4]])
>>> image2 = Image.from_array([[1, 1], [1, 1]])
>>> image3 = add(image1, image2)
>>> image3.data
array([[2, 3],
       [4, 5]])