我希望能够用另一个上传的图像覆盖图像
I want to be able to overlay the image with another uploaded image
我想做一个小型网店,我需要上传客户图片并将其显示在例如杯子上,就像动机一样,这样背景上就会有干净的白色杯子,客户上传图片,这张图片就会显示出来在杯子的中央。如果有像这些 somenting 的插件,请告诉我。泰!
为什么不使用 canvas HTML5 tag and then use the method drawImage() to draw the white cup and use the same method for drawing the user picture on top of it? Otherwise you could use imagemagick 在服务器端合并两个图像。
在 PHP 中,您可以创建一个变量来保存默认图像,例如$img = 'default.jpg';
然后检查是否已上传 img 并相应地更新 $img,例如$img = $_POST['img_upload'];
在标记中回显 $img 以显示默认或上传的 img。我想你明白了,可以填补缺失的部分。
有两个 Imagagemagick 论坛用户有一些代码可以执行此操作:
fmw42's cylinderize script - 您需要付费才能用于商业用途和
snibgo's coffee cup script
我想做一个小型网店,我需要上传客户图片并将其显示在例如杯子上,就像动机一样,这样背景上就会有干净的白色杯子,客户上传图片,这张图片就会显示出来在杯子的中央。如果有像这些 somenting 的插件,请告诉我。泰!
为什么不使用 canvas HTML5 tag and then use the method drawImage() to draw the white cup and use the same method for drawing the user picture on top of it? Otherwise you could use imagemagick 在服务器端合并两个图像。
在 PHP 中,您可以创建一个变量来保存默认图像,例如$img = 'default.jpg';
然后检查是否已上传 img 并相应地更新 $img,例如$img = $_POST['img_upload'];
在标记中回显 $img 以显示默认或上传的 img。我想你明白了,可以填补缺失的部分。
有两个 Imagagemagick 论坛用户有一些代码可以执行此操作: fmw42's cylinderize script - 您需要付费才能用于商业用途和 snibgo's coffee cup script