title: How to change the RGB to BGR in python PIL IMAGE?P
body: <p>I have an image where the colors are based on RGB . How could I use PIL image library to change RGB to BGR.</p>
  
  <p>Yes, it is very similar to <a href="https://stackoverflow.com/questions/4661557/pil-rotate-image-colors-bgr-rgb">PIL rotate image colors (BGR -> RGB)</a> but working in the opposite, my purpose is to change RGB to BGR whereas the similar question is about changing BGR to RGB.  </p>
  
  <pre><code>b, g, r = im.split()
  im = Image.merge("RGB", (r, g, b))
  </code></pre>
  
  <p>seems to be a simpler solution, but split() doesn't support to latest PIL anymore. </p>
  
  <p>What I like to know more is how to reverse this underlying code from RGB to BGR</p>
  
  <pre><code>data = np.asarray(im)
  im = Image.fromarray(np.roll(data, 1, axis=-1))
  </code></pre>
  
  <p>---------------------------------------update -------------------------</p>
  
  <pre><code>pil_im_obj = Image.open(path)
  print pil_im_obj
  # output &lt;PIL.JpegImagePlugin image mode= RGB size=591*500&gt;
  data = np.asarray(pil_im_obj)
  pil_im = Image.fromarray(np.roll(data,1,axis=-1))
  print pil_im
  
  #output  : &lt;PIL.Image.Image image mode = RGB size= 591*500&gt;
  </code></pre>
  
  <p>I tried the conversion as mentioned in the comments, but still output shows after the conversion, it is still RGB image</p>