PHP embossed with color

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

My ultimate goal is to make this effect http://www.flickr.com/photos/ 52700219@N06 / 6729984045 / in / photostream / , and I can do it like http://www.flickr.com / photos / 52700219@N06 / 6759029339 / , specifying a gray line for each square.

So far, I only find the embossing effect, which will cause the image color to turn gray, as when using imageconvolution or IMG_FILTER_EMBOSS. How can i do this?

+1
source share
1 answer

The embossing effect that you showed on the example of the “globe” is simply the general core of the convolution. 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); 
+3
source

Source: https://habr.com/ru/post/906451/


All Articles