Color color = grayScale.GetPixel(xCoordinate, yCoordinate); sum = (color.R + color.G + color.B); red = color.R; green = color.G; blue = color.B; redColor = (double)red/ (double)(sum); greenColor = (double)green / (double)(sum); blueColor = (double)blue /(double)(sum); //Color.FramArgb only accepts int and my val;ues are in double since they are normalized b/w 0-1 grayScale.SetPixel(xCoordinate, yCoordinate, Color.FromArgb(redColor, greenColor,blueColor)); }
grayScale.SetPixel(xCoordinate, yCoordinate, Color.FromArgb((int)(255*redColor), (int)(255*greenColor),(int)(255*blueColor)));
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)