# What is meant by product of two images?

I would like to compute the product of two images. I tried with the code below. But the result is not like I expected. Can you tell me where is the problem in my code?

https://ibb.co/Njc8w3b

for (int i = 0; i < ImageWidth; i++)
{
for (int j = 0; j < ImageHeight; j++)
{
PixelValueFirstImage = Giris1.GetPixel(i, j);
PixelValueSecondImage = Giris2.GetPixel(i, j);
Greyscale1 = Convert.ToInt16(PixelValueFirstImage.R * 0.3 + PixelValueFirstImage.G * 0.58 + PixelValueFirstImage.B * 0.12); //Converting RGB to grayscale
Greyscale1 = Convert.ToDouble((Greyscale1 - 0) / (255 - 0)); // scaling between 0-1
Greyscale = Convert.ToInt16(PixelValueSecondImage.R * 0.3 + PixelValueSecondImage.G * 0.58 + PixelValueSecondImageB * 0.12); //Converting RGB to grayscale
Greyscale = Convert.ToDouble((Greyscale - 0) / (255 - 0)); // scaling between 0-1
product = Greyscale * Greyscale1; // result of product
product =(255*product)  ; //scaling between 0-255
OutputImage.SetPixel(i, j, Color.FromArgb((int)product, (int)cproduct, (int)product);
}
}

$$$$
`
• What was your result, what did you expect and how are these two things different? – Hilmar Aug 5 at 12:56

• I think that masking can be a bit more complicated, because it can involve normalization (typically $[0,1]$) or saturation. – Laurent Duval Aug 5 at 13:26