How to print a text on a image using PHP as watermark?

General discussion on PHP
Post Reply
ashi4275
Posts: 15
Joined: Fri Jul 15, 2016 10:02 am

How to print a text on a image using PHP as watermark?

Post by ashi4275 » Mon Aug 01, 2016 11:25 am

Hi, i am looking for some example code that help me to learn how to print the text over a image as a water mark. Hoping for valuable suggestions.

User avatar
zvika
Zend Global Support
Posts: 996
Joined: Sun Dec 14, 2008 9:48 am
Contact:

Re: How to print a text on a image using PHP as watermark?

Post by zvika » Sun Aug 21, 2016 1:44 pm

You usually use a library for that, which renders fonts and text + params onto an image object and renders the result to send back to the browser.
http://php.net/manual/en/function.imagettftext.php

Please google "add text to image with php" for examples.
Zvika Dror
Zend Support Team

rob6279
Posts: 4
Joined: Tue Mar 20, 2018 11:44 am

Re: How to print a text on a image using PHP as watermark?

Post by rob6279 » Tue Mar 20, 2018 11:59 am

It worked. Thanks for the link.

glen755
Posts: 1
Joined: Fri Apr 13, 2018 8:03 am
Contact:

Re: How to print a text on a image using PHP as watermark?

Post by glen755 » Fri Apr 13, 2018 8:12 am

For your general enlightenment: The accompanying drop-in capacity will put a piece of completely advocated content onto a GD picture. It is a little CPU substantial, so I recommend reserving the yield as opposed to doing it on-the-fly.

Post Reply