public Image ToImage() { Bitmap bmp = new Bitmap(Width, Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb); int iWidth = Width; int iHeight = Height; UnsafeBitmap output = new UnsafeBitmap(iWidth, iHeight); output.LockBitmap(); for (int j = 0; j < iHeight; j++) // Parallel.For(0, iHeight, j => { for (int i = 0; i < iWidth; i++) { PixelData pixelInput = array[i][j]; output.SetPixel(i, j, pixelInput); } //}); } output.UnlockBitmap(); return output.Bitmap; //for (int j = 0; j < Height; j++) //{ // for (int i = 0; i < Width; i++) // { // bmp.SetPixel(i, j, array[i, j].ToColor()); // } //} //return bmp; }