title: Changing the color of a mask OpenCV 3
body: <p>I want to change the color of my mask which is black to any different color.</p>
  
  <p>Here is my mask</p>
  
  <h2><a href="https://i.stack.imgur.com/E9KZm.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/E9KZm.jpg" alt="enter image description here"></a></h2>
  
  <p>and here is my original image</p>
  
  <p><a href="https://i.stack.imgur.com/0Natx.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0Natx.jpg" alt="enter image description here"></a></p>
  
  <p>I know that if I use this function</p>
  
  <pre><code>src.copyTo(dst, mask);
  </code></pre>
  
  <p>it will allow me to use the mask properly and to have a result like this</p>
  
  <p><a href="https://i.stack.imgur.com/QhwQZ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QhwQZ.jpg" alt="enter image description here"></a></p>
  
  <p>However whenever I change the mask color to non black it doesn't make anything to <code>dst</code> Mat.</p>
  
  <p>Is there a way to use a mask with non-black mask?</p>
  
  <p>I don't want to use looping function because I know it'll cost me a lot of processing time.</p>
  
  <p>Thanks</p>