2

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!

Anh3Saigon
  • 199
  • 5
Muzamil Hassan
  • 841
  • 1
  • 11
  • 23

1 Answers1

4

@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:

Cheers and good luck!

Community
  • 1
  • 1
Kevin Bomberry
  • 3,122
  • 4
  • 22
  • 18