title: How to convert RGB PIL image to numpy array with 3 channels?
body: <p>I am loading image with the following code</p>
  
  <pre><code>image = PIL.Image.open(file_path)
  image = np.array(image)
  </code></pre>
  
  <p>It works, but the size of array appears to be <code>(X, X, 4)</code>, i.e. it has 4 layers. I would like normal RGB layers. Is it possible?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I found that just removing 4th channel is unsufficcient. The following code was required:</p>
  
  <pre><code>image = PIL.Image.open(file_path)
  image.thumbnail(resample_size)
  image = image.convert("RGB")
  image = np.asarray(image, dtype=np.float32) / 255
  image = image[:, :, :3]
  </code></pre>
  
  <p>Why?</p>