PHP浮雕彩色

发布于 2025-01-01 05:11:30 字数 576 浏览 2 评论 0原文

我需要在 PHP 中为图像制作浮雕效果。但我需要保留真实的颜色,就像 http://loriweb.pair.com 中的地球仪图片/8udf-emboss.html

我的最终目标是做出这样的效果http://www.flickr.com/photos/52700219@N06/6729984045/在/photostream/中,我只能做到这样http://www.flickr.com/photos/52700219@N06/6759029339/为每个方块给出灰线。

到目前为止,我只发现浮雕效果会使图像颜色变成灰色,例如 当使用图像卷积或 IMG_FILTER_EMBOSS 时。 我该怎么做?

I need to make an emboss effect for an image in PHP. But I need to keep the real color, like the globe picture in http://loriweb.pair.com/8udf-emboss.html

My final target is to make effect like this http://www.flickr.com/photos/52700219@N06/6729984045/in/photostream/ and I can only make it like this http://www.flickr.com/photos/52700219@N06/6759029339/ by giving grey line for each square there.

Until now, I only find emboss effect that will make the image color become gray like
when using imageconvolution or IMG_FILTER_EMBOSS.
How can I do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

飘落散花 2025-01-08 05:11:30

您在“地球”示例中展示的浮雕效果只是一个通用的卷积核。您可以使用imageconvolution()实现相同的效果:

$kernel = array(array(1, 1, -1), array(1, 1, -1), array(1, -1, -1));
imageconvolution($image, $kernel, 1, 0);

The emboss effect that you showed on the "globe" example is just a generic convolution kernel. You can accomplish the same effect using imageconvolution():

$kernel = array(array(1, 1, -1), array(1, 1, -1), array(1, -1, -1));
imageconvolution($image, $kernel, 1, 0);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文