title: How erase part of UIImage
body: <p>Is there a way to erase the black background for that image
  <img src="https://i.stack.imgur.com/Qdoqf.png" alt="alt text"></p>
  
  <p>I've found this sample code found on this <a href="https://stackoverflow.com/questions/1487601">topic</a> but i don't understand how it works </p>
  
  <pre><code>- (void)clipImage {
    UIImage *img = imgView.image;
    CGSize s = img.size;
    UIGraphicsBeginImageContext(s);
    CGContextRef g = UIGraphicsGetCurrentContext();
    CGContextAddPath(g,erasePath);
    CGContextAddRect(g,CGRectMake(0,0,s.width,s.height));
    CGContextEOClip(g);
    [img drawAtPoint:CGPointZero];
    imageView.image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
  }
  </code></pre>
  
  <p>Maybe I'm in the wrong way.<br></p>
  
  <p>Regards,<br>
  kl94</p>