1

I have a base GPUImagePicture (Layer 1) and then another GPUImagePicture (Layer 2) that I have added a bunch of filters to.

When I put them together into one image they look fine but what I would like to do is move Layer 2 with my finger to different positions on Layer 1. Is this possible without using something like Cocos2D?

ExoticBirdsMerchant
  • 1,466
  • 8
  • 28
  • 53
Joel Parker
  • 295
  • 1
  • 4
  • 17

1 Answers1

1

Try to add an GPUImageTransformFilter with an affine transform set correctly to translation to one of your GPUImagePicture before blending.
If you need to make a more sophisticated manipulation I think that you should extract from one of the original image the correct portion, redraw in a transparent background image (same size of the first one) and then blend.
To build the affine transform to apply you can easily use a UIPanGestureRecognizer on a touch detecting overlay view.

Andrea
  • 26,120
  • 10
  • 85
  • 131
  • Found a similar answer here http://stackoverflow.com/questions/20031006/blending-with-gpuimage-how-to-control-the-position-of-the-second-image-on-top-o – Andrea May 19 '14 at 17:56