title: C++ 16 bit grayscale gradient image from 2D array
body: <p>I'm currently trying to build a 16 bit grayscale "gradient" image but my output looks weird so I'm clearly not understanding this correctly. I was hoping somebody could shine some knowledge on my issue. I think that the "bitmap" I write is wrong? But I'm not sure. </p>
  
  <pre><code>#include "CImg.h"
  using namespace std;
  
  unsigned short buffer[1250][1250];
  
  void fill_buffer()
  {
      unsigned short temp_data = 0;
      for (int i =0;i &lt; 1250; i++)
      {
          for (int j =0 ;j &lt; 1250;j++)
          {
              buffer[i][j] = temp_data;
          }
          temp_data += 20;
      }
  }
  
  int main()
  {
      fill_buffer();
      auto hold_arr = (uint8_t *)&amp;buffer[0][0];
      cimg_library::CImg&lt;uint8_t&gt; img(hold_arr, 1250, 1250);
      img.save_bmp("test.bmp");
      return 0;
  }
  </code></pre>
  
  <p>Current Output:
  <img src="https://i.stack.imgur.com/00SdH.png" alt="Current Output"></p>