I have two images and I want to merge those two images like I have a image of mug and second image is any image. Now I want to merge with it to mug how could I achieve this like the image which will placed on mug must wrap up first like I take pic from camera and than paste that into mug but how I wrap that image!
1 Answers
@Akhil: You are asking a very complicated question that goes out of the realm of simple iOS development. If your question is specifically, "wrap an image on a mug," then it can be approached as, "apply a texture to a mesh object," in which case you'll want to be using OpenGL ES, and have predefined models (with UV mapping) to apply the image/texture on to.
In addition, you could use OpenGL and perform a grid mesh translation (mesh warping)—that is to say you'll take an image on a mesh (with a (grid) resolution) and then manipulate all of the points to create the warp effect. Also, GLKit may help in this process and Core Image may also provide a simple solution.
If you're question is, I have a random image and I want to derive the 3D shape of it, then apply a second image to the derived shape and composite them together, that's even trickier as the first part will take advanced image processing to determine the original object/selection shape.
Here is some additional information:
- Apple's GLCameraRipple sample code: http://developer.apple.com/library/ios/#samplecode/GLCameraRipple/Introduction/Intro.html
- Paper on Image Warping (PDF): http://www.seas.upenn.edu/~cse399b/Lectures/CSE399b-07-warp-mesh.pdf
- OpenGL reference for image warping: http://paulbourke.net/dataformats/meshwarp/
- Tutorials for GLKit: http://maniacdev.com/ios-5-sdk-tutorial-and-guide/glkit/
- Tutorials for Core Image: http://maniacdev.com/ios-5-sdk-tutorial-and-guide/core-image-example/
- A handout from NTU on image warping (PDF): http://www.csie.ntu.edu.tw/~cyy/courses/vfx/05spring/lectures/handouts/lec03_morphing_4up.pdf
- Associated information from StackOverflow: iOS images in a bubble effect
Cheers and good luck!

- 1
- 1

- 3,122
- 4
- 22
- 18