title: How to Implement GPUImageMaskFilter using GPUImage
body: <p>I need to Cut from the Full Image using the mask and created the masked Image.</p>
  
  <p><img src="https://i.stack.imgur.com/GmQP6.png" alt="Full Image"> <strong>+</strong><img src="https://i.stack.imgur.com/17gT0.png" alt="Mask Image"><strong>=</strong><img src="https://i.stack.imgur.com/Sdb2M.png" alt="enter image description here"></p>
  
  <p>I tried the following:</p>
  
  <pre><code>UIImage *imgMask = [UIImage imageNamed:@"Mask.png"];
  UIImage *imgBgImage = [UIImage imageNamed:@"Full.png"];
  
  
  
  GPUImageMaskFilter *maskingFilter = [[GPUImageMaskFilter alloc] init];
  
  
  GPUImagePicture * maskGpuImage = [[GPUImagePicture alloc] initWithImage:imgMask ];
  
  GPUImagePicture *FullGpuImage = [[GPUImagePicture alloc] initWithImage:imgBgImage ];
  
  
  
  
  [maskGpuImage addTarget:maskingFilter];
  [maskGpuImage processImage];
  
  
  [maskingFilter useNextFrameForImageCapture];
  
  
  [FullGpuImage addTarget:maskingFilter];
  [FullGpuImage processImage];
  
  
  
  UIImage *OutputImage = [maskingFilter imageFromCurrentFramebuffer];
  </code></pre>
  
  <p>But , my generated output image is: <img src="https://i.stack.imgur.com/mmfAh.png" alt="enter image description here"></p>
  
  <p>Please guys join hands.
  Cheers.</p>
  
  <p>Also,Thanks to <a href="https://github.com/BradLarson/GPUImage" rel="noreferrer">BradLarson</a>.</p>