title: How to convert grayscale values in matrix to an image in Python?
body: <p>I have a set of grayscale values in matrix of shape 24x24:</p>
  
  <pre><code>masked=[[149 172 160 166 170 179 180 176 202 190 221 232 125 112 153 132 200 185
    191 231 227 101  85 127] ...
  </code></pre>
  
  <p>And I try to save this matrix file to a grayscale image as follows:</p>
  
  <pre><code>im = Image.fromarray(masked_crop)
  im.save('crop.png')
  </code></pre>
  
  <p>But instead of having those values in my image, I get a complete dark image of size 24x24. 
  Where am I going wrong? </p>