How to add glow or shadow to text in PHP GD library?

Can I add a glow or shadow to text in GD? I am currently using the imagettftext function.

+5
source share
1 answer

I ran into this problem and created a new function called imagettftextblurthat I released as open source at https://github.com/andrewgjohnson/imagettftextblur

Here's how to add a shadow:

imagettftextblur($image,$size,0,$x + 3,$y + 3,$shadow_color,$font,$string,1); // 1 can be higher to increase blurriness of the shadow
imagettftextblur($image,$size,0,$x,$y,$text_color,$font,$string);
+16
source

All Articles