public CIEModel[,] setCIEImage(Bitmap image) { CIEModel[,] CIEImage = new CIEModel[image.Width, image.Height]; for (int x = 0; x < image.Width; x++) { for (int y = 0; y < image.Height; y++) { // Get the color of a pixel within myBitmap. Color pixelColor = image.GetPixel(x, y); int r = (int)pixelColor.R; int g = (int)pixelColor.G; int b = (int)pixelColor.B; CIEImage[x, y] = CIEController.RGBtoXYZ(r, g, b); } } return(CIEImage); }