title: Convert numpy array to rgb image
body: <p>I have a <code>numpy</code> array with value range from <code>0-255</code>. I want to convert it into a 3 channel RGB image. I use the <code>PIL Image.convert()</code> function, but it converts it to a grayscale image.</p>
  
  <p>I am using Python <code>PIL</code> library to convert a <code>numpy</code> array to an image with the following code:</p>
  
  <pre><code>imge_out = Image.fromarray(img_as_np.astype('uint8'))
  img_as_img = imge_out.convert("RGB")
  </code></pre>
  
  <p>The output converts the image into 3 channels, but it's shown as a black and white (grayscale) image. If I use the following code </p>
  
  <pre><code>img_as_img = imge_out.convert("R")
  </code></pre>
  
  <p>it shows </p>
  
  <pre><code>error conversion from L to R not supported
  </code></pre>
  
  <p>How do I properly convert numpy arrays to RGB pictures?</p>