将图像凸形地包裹在产品图像上

Wrapping an image over a product image convexly

我想要的:当我在枕头纹理上应用图像时,图像的艺术品应该在枕头上凸起。

Here is the link for the desired image

以上输出是我想要的正确输出

注意:在上图中,您可以看到图像围绕着角,从中心凸起。

问题:但是当我在枕头纹理上应用图像时,图像艺术品没有凸出弯曲。

Here is the the output I currently have

另外,供参考,

here is the product image that I am using

And here is the artwork, that I am overlaying it with

此外,在上面链接的产品图片中,如您所见,左上角有一些变形,如果我用任何设计覆盖它,我怎样才能实现这种变形。

我是imagemagick新手,请问有什么好的资源可以学习和练习吗?

以下是在 ImageMagick 中的操作方法。

输入:

先给枕头做个面具。 ImageMagick 得不到好的遮罩,所以我使用 http://remove.bg 使背景透明,然后提取 alpha 通道并得到:

然后我测量了遮罩白色部分的大小和偏移量:

convert mask.png -format "%@" info:
642x646+78+77

然后我处理了图像。我调整了文本图像的大小,然后应用枕形畸变(与桶形畸变相反)并将其插入到与上方偏移位置处的枕头大小的白色图像中。然后使用蒙版,我对枕头和扭曲的图像进行了混合合成,得到了结果。参见 https://imagemagick.org/Usage/distorts/#barrel

convert pillow.jpg \
\( -size 800x800 xc:white \
\( pillow_overlay.jpg -resize 646x646 -distort barrel "0.0 0.0 -0.2 1.3" \) \
-geometry +78+77 -compose over -composite +geometry \) \
mask.png -define compose:args=60,40 -compose blend -composite \
pillow_new.jpg