title: How to convert black parts of an RGBA image to transparent in opencv
body: <p>I have an image in rgba format with (0,0,0) blacks in it, and I want to covert each of these (0,0,0) pixels to transparent. The image already has an alpha channel, and I don't know how to activate the alpha channel for a pixel. I tried setting the alpha channel value to 0, but it hasn't worked so far:</p>
  
  <pre><code>        for y in range(len(blur)):
              for x in range(len(blur[0])):
                  if blur[y][x][0] == 0 and blur[y][x][1] == 0 and blur[y][x][2] == 0:
                      blur[y][x][3] = 0
  
  </code></pre>
  
  <p>Also how can I optimize this nested for loop using numpy instead?</p>