i'm learning programming , and i'm stuck on this error for a long time
i tried changing variable to float
Color col;
float red, green, blue,gray;
for (int i = 0; i < oImage.Width; i++)
for (int j = 0; j < oImage.Height; j++)
{
col = oImage.GetPixel(i, j);
red = col.R;
green = col.G;
blue = col.B;
gray = red*0.21 + green*0.72 + blue*0.07;
oImage.SetPixel(i, j, Color.FromArgb(gray, gray, gray));
}
picImage.Refresh();
i expect the output is to convert a normal photo to a luminosity background