title: Core Image Filter CISourceOverCompositing not working Properly
body: <p>I am Working on Photo Editing App and I have to <strong>merge two Images one Over another like this</strong>.</p>
  
  <p><img src="https://i.stack.imgur.com/6ChoG.png" alt="enter image description here"></p>
  
  <p>I have implemented the <strong>following code</strong> to do so:<br>
  Here imgedit is the background image and<br>
       imgEdit is the UIImageView containing imgedit.</p>
  
  <pre><code>        UIImage *tempImg = [UIImage imageNamed:[NSString stringWithFormat:@"borderImg"]];
          CIImage *inputBackgroundImage = [[CIImage alloc] initWithImage:imgedit];
          CIImage *inputImage = [[CIImage alloc]initWithImage:tempImg] ;
  
          CIFilter *filter = [CIFilter filterWithName:@"CISourceOverCompositing"];
          [filter setDefaults];
          [filter setValue:inputImage forKey:@"inputImage"];
          [filter setValue:inputBackgroundImage forKey:@"inputBackgroundImage"];
  
          CIImage *outputImage1 = [filter valueForKey:@"outputImage"];
          CIContext *context = [CIContext contextWithOptions:nil];
          imgEdit.image = [UIImage imageWithCGImage:[context createCGImage:outputImage1 fromRect:outputImage1.extent]];
  </code></pre>
  
  <p>But the <strong>outputImage I am getting after implementing above code</strong> is:<br>
  <img src="https://i.stack.imgur.com/Hm9GS.png" alt="enter image description here">  </p>
  
  <p>I have also tried to <strong>resize</strong> the input white frame image, by using following code:  </p>
  
  <pre><code>        tempImg=[tempImg resizedImageToSize:CGSizeMake(imgEdit.image.size.width,imgEdit.image.size.height)];  
  </code></pre>
  
  <p>By using above code image get resized properly but But that is also not working.  </p>
  
  <p>Please help me out from here.<br>
  Your valuable help will be highly appreciated.<br>
  Thankyou in advance.</p>