1

I have two images, one background image (img_back.png) and other is an image (person.jpg), Now i need to paste this person.jpg image into the img_back.png image so that it looks like the person.jpg has background. Tried lots of commands like -composite, -blend, -combine, etc, but none of it worked. So can anyone pls show me how can i do it using Imagemagick..

1 Answer 1

0

person.jpg inherently has no transparency so this isn't so trivial. You would have to create a mask around the person to create a new alpha channel, then you could composite the picture.

If person.jpg is a person on a white background this might not be too crazy but you might need to venture into OpenCV to perform image processing to find the outline of the person.

If you test out JibJab Sendables you can see one method of working around this. Defer the creation of the face or person mask to the user.

enter image description here

Not the answer you're looking for? Browse other questions tagged or ask your own question.