I have a background image: ,
on which i fuse a circle(or eclipse):
so that the area equal to circle becomes transparent on the background image just like this: .
I have used php and image magick to achieve this
Now, I have to insert an image into the hole in such a way that:
How this can be achieved in php using image magick? Any pointers or help will very useful.
To transfer image below the background on layer, can this be done using z-index?
In order to achieve the above, I took this appraoch:
I place a image in a div (exactly surrounding the circle) which is behind the background image. The div has overflow hidden, so I can contain image.
In order to drag image I transfer mouse down event on background image to the below div. This can be done using jQuery trigger.
Now to crop the image I calculate the x,y offset of images and crop height and width accordingly and send data to server to crop it.
Hope this helps someone else.
Cropping the image to the same dimensions as the circle and then place it on top of the background image at position posX,posY etc could work as a nice straight forward solution.