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.
发布评论
评论(1)
person.jpg
本质上没有透明度,所以这并不是那么简单。您必须在人物周围创建一个遮罩以创建新的 Alpha 通道,然后才能合成图片。如果
person.jpg
是一个白色背景的人,这可能不会太疯狂,但您可能需要冒险使用 OpenCV 来执行图像处理以找到人的轮廓。如果您测试JibJab Sendables,您可以看到解决此问题的一种方法。将面部或人物蒙版的创建推迟给用户。
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.