How to replace a given color with another on an opaque UIImage
<p>I want to change the color of an opaque UIImage. My original image is as follows:</p>
<p><a href="https://i.stack.imgur.com/Dcd6D.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Dcd6D.png" alt="enter image description here" /></a></p>
<p>and I want to convert the image to the following format</p>
<p><a href="https://i.stack.imgur.com/ZfNri.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZfNri.png" alt="enter image description here" /></a></p>
<p>So, basically I want to convert <strong>red</strong> color in the image into <strong>black</strong> (Any other color) color. Above two images are added for better understanding.</p>