title: Create an image from byte[] using ImageSharp
body: <p>I have a <code>byte[]</code> and I want to create a gray-scale image using <a href="https://github.com/SixLabors/ImageSharp" rel="noreferrer">ImageSharp</a> library.</p>
  
  <p>That is how I am doing it currently:</p>
  
  <pre><code>byte[] arr = MnistReader.ReadTestData(); //this gives me byte[] with 784 pixel values
  
  ImageSharp.Image image = new ImageSharp.Image(28, 28);
  
  for (int i = 0; i &lt; image.Height; i++)
  {
      for (int j = 0; j &lt; image.Width; j++)
      {
          int curPixel = j + i * image.Width;
          image.Pixels[curPixel].R = arr[curPixel];
          image.Pixels[curPixel].G = arr[curPixel];
          image.Pixels[curPixel].B = arr[curPixel];
      }
  }
  </code></pre>
  
  <p>I wonder if there is a more elegant way to do it ?</p>