title: Convert (B,G,R,IR) to (R,G,B) image arrays - Python
body: <p>I have some satellite images, and I wanted to convert them to regular RGB images. The Satellite images are in the (B,G,R,IR) ranges. I want to convert them to (RGB images). Currently, I am doing the following:</p>
  
  <pre><code>    img1 = img[ :, :, :-1].copy()
      img1 = img1*255.0/img1.max()
      img2 = np.zeros(np.shape(img1))
      img2[:,:,0] = img1[:,:,2]
      img2[:,:,1] = img1[:,:,1]
      img2[:,:,2] = img1[:,:,0]
      img2 = img2.astype(np.uint8)
  </code></pre>
  
  <p>The above code looks positively ugly. I am wondering if there is some neat trick to doing this. Some form of <code>hstack</code>, <code>vstack</code> etc, Or some form of smart transpose ...</p>