PHP emboss with color

不打扰是莪最后的温柔 提交于 2019-12-11 06:57:18

问题


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?


回答1:


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);


来源:https://stackoverflow.com/questions/9106893/php-emboss-with-color

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!