title: Problem about Background transparent .png format OpenCV with Python
body: <p>I'm studying on OpenCV with Python. I tried to change a color of picture in PNG format, but I have got some problem with PNG background (The image has transparent background).</p>
  
  <p>When I change it to grayscale, the background has changed to black -- my picture is not transparent anymore. What I desire is to keep the transparent background of picture.</p>
  
  <hr>
  
  <p><strong>Original image:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/51IgH.png" rel="noreferrer"><img src="https://i.stack.imgur.com/51IgH.png" alt=""></a></p>
  
  <p><strong>My code:</strong></p>
  
  <pre><code>img = cv2.imread('line.png',cv2.IMREAD_UNCHANGED)
  cv2.imshow('line',img)
  cv2.waitKey()
  </code></pre>
  
  <p><strong>Output image:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/a4v79.png" rel="noreferrer"><img src="https://i.stack.imgur.com/a4v79.png" alt=""></a></p>
  
  <p><strong>Desired output:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/hCj0R.png" rel="noreferrer"><img src="https://i.stack.imgur.com/hCj0R.png" alt=""></a></p>
  
  <p>The white color around the border image should be transparent. How I can do this?</p>