title: How to save an image with more than 3 channels using PIL?
body: <p>I need to save a tiff image with 4 channels, specifically R,G,B and A channels.</p>
  
  <p>When I try using <code>Image.save()</code> to save a tiff with 4 channels, the resulting image is an RGBA image but when examining the tiff in Photoshop the only channels are RGB, without the Alpha. Is there any way to merge 4 channels to a RGBA image, with a 4th channel (a separate alpha channel)?</p>
  
  <p>Below is an example of what I've tried</p>
  
  <pre><code>from PIL import Image
  
  # import image A
  inputImageA = Image.open(input_imageA_path)
  
  # import image B
  inputImageB = Image.open(input_imageB_path)
  
  # split channels
  R, G, B, A = inputImageA.split()
  alpha_channel = inputImageA.split()[-1]
  
  # merge 4 channels back into a single image
  outputImage = Image.merge("RGBA", [R,G,B,alpha_channel])
  
  # save the new image
  outputImage.save(ouput_image_path)
  </code></pre>
  
  <p>In this example the resulting output image only has 3 channels (RGB).</p>
  
  <p>Please see below image for a visual explanation of what I'm trying to do:</p>
  
  <p><img src="https://i.imgur.com/7bvuzJJ.png" alt="example"></p>