**8.B] Briefly explain arithmetic operations on images**

Answer:

Arithmetic operations on images include addition, subtraction, multiplication, division, and blending. These operations are fundamental for various image-processing tasks.

**Image Addition**

Two images can be added directly as:

`g(x,y) = f1(x,y) + f2(x,y)`

The pixels of the input images `f1(x,y)`

and `f2(x,y)`

are added to obtain the resultant image `g(x,y)`

. When adding images, care should be taken to ensure that the sum does not exceed the allowed range (e.g., 0-255 for a grayscale image). If the sum exceeds this range, the pixel value is set to the maximum allowed value.

It is also possible to add a constant value to a single image, as follows:

`g(x,y) = f1(x,y) + k`

Where `k`

is a constant. If `k`

is positive, the overall brightness of the image increases.

**Applications of Image Addition:**

- Creating double exposure effects.
- Increasing the brightness of an image.

**Image Subtraction**

Image subtraction can be performed as:

`g(x,y) = f1(x,y) - f2(x,y)`

Where `f1(x,y)`

and `f2(x,y)`

are the input images. To avoid negative values, it is common to take the modulus of the difference:

`g(x,y) = |f1(x,y) - f2(x,y)|`

Subtraction can also be performed with a constant:

`g(x,y) = |f1(x,y) - k|`

Where `k`

is a constant, reducing the overall brightness of the image.

**Applications of Image Subtraction:**

- Background elimination.
- Brightness reduction.
- Change detection.

**Image Multiplication**

Image multiplication is performed as:

`g(x,y) = f1(x,y) * f2(x,y)`

If the multiplied value exceeds the maximum allowed value, it is reset to the maximum. Scaling by a constant can also be performed:

`g(x,y) = f(x,y) * k`

Where `k`

is a constant. If `k > 1`

, the contrast increases; if `k < 1`

, the contrast decreases.

**Applications of Image Multiplication:**

- Increasing contrast.
- Designing filter masks.
- Creating a mask to highlight areas of interest.

**Image Division**

Image division is performed as:

`g(x,y) = f1(x,y) / f2(x,y)`

Where `f1(x,y)`

and `f2(x,y)`

are the input images. This operation may result in floating-point numbers, so appropriate data types should be used. Division with a constant can also be performed:

`g(x,y) = f(x,y) / k`

Where `k`

is a constant.

**Applications of Image Division:**

- Change detection.
- Separation of luminance and reflectance components.
- Contrast reduction.