title: OpenCV - Splitting and merging alpha channels slow
body: <p>I am using Python OpenCV to split channels and remove black background like this...</p>
  
  <pre><code>    b_channel, g_channel, r_channel = cv2.split(image_1)
      alpha_channel = np.zeros_like(gray)
  
      for p in range(alpha_channel.shape[0]):
          for q in range(alpha_channel.shape[1]):
              if b_channel[p][q]!=0 or g_channel[p][q]!=0 or r_channel[p][q]!=0:
                  alpha_channel[p][q] = 255
  
      merged = cv2.merge((b_channel, g_channel, r_channel, alpha_channel))
  </code></pre>
  
  <p>This is working, but it is taking around 10 seconds to complete on an image that is only 200kb</p>
  
  <p>Is there a more efficient way to do this or is there some speed gains I could make using the code I have?</p>