PHP/GD 图像映射/纹理
我正在尝试创建一个类似于以下内容的产品配置器: http:// /winmap.active-online.de/kler/pol/index.php3?room_name=200D 我想在不同的图像元素上放置纹理或颜色,并将其组合成一个结果图像。
我正在尝试这样使用:
header('Content-Type: image/jpeg');
$poszycie = imagecreatefrompng('poszycie.png');
$tekstura = imagecreatefrompng('tekstura.png');
//imagefilter($poszycie,IMG_FILTER_EMBOSS);
//imagepng($tekstura);
//$bcg = imagecreatefromjpeg('las.jpg');
//$img = imagecreatefromjpeg('zdjecie.jpg');
//imagecopymerge($poszycie, $tekstura, 0, 0, 0, 0, imagesx($poszycie), imagesy($poszycie), 75);
//imagepng($poszycie, null, 100);
imagecopymerge($poszycie, $tekstura, 0, 0, 0, 0, imagesx($poszycie), imagesy($poszycie), 50);
imagepng($poszycie);
但结果是:http://saveur.pl/testgd/configurator。 感谢您
的帮助。
I'm trying to create a produkt configurator similar to: http://winmap.active-online.de/kler/pol/index.php3?room_name=200D
I'd like to put texture or color on diffrent image elements and put it together into one result image.
I'm trying to usa like this:
header('Content-Type: image/jpeg');
$poszycie = imagecreatefrompng('poszycie.png');
$tekstura = imagecreatefrompng('tekstura.png');
//imagefilter($poszycie,IMG_FILTER_EMBOSS);
//imagepng($tekstura);
//$bcg = imagecreatefromjpeg('las.jpg');
//$img = imagecreatefromjpeg('zdjecie.jpg');
//imagecopymerge($poszycie, $tekstura, 0, 0, 0, 0, imagesx($poszycie), imagesy($poszycie), 75);
//imagepng($poszycie, null, 100);
imagecopymerge($poszycie, $tekstura, 0, 0, 0, 0, imagesx($poszycie), imagesy($poszycie), 50);
imagepng($poszycie);
but result is :http://saveur.pl/testgd/configurator.png
Thanks for any help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为使用 ImageMagick 会更好。例如,您可以使用这些技巧 http: //www.imagemagick.org/discourse-server/viewtopic.php?f=2&t=14513&start=15 并且我确定在网络上搜索
imagemagick 纹理图像区域
将揭示更多想法。不管怎样,你必须拆开图像并使用 Alpha 通道。
I think you'll be better off with ImageMagick. For example you could use these tricks http://www.imagemagick.org/discourse-server/viewtopic.php?f=2&t=14513&start=15 and I'm sure a web search for
imagemagick texture image area
would reveal more ideas.Anyway you'll have to take apart the image and use the alpha channel.
我认为我对这个问题的回答可以提供帮助。问题涉及 alpha 通道。此外,您应该发送此标头(png 而不是 jpeg):
因为您正在调用,
这可能是另一个麻烦原因。
I think my answer to this question can help. The problem deals with alpha channel. Besides, you should send this header (png instead of jpeg):
since you are calling
which may be another cause of trouble.