Adding watermark to image in PHP

后端 未结 2 1838
情深已故
情深已故 2020-12-21 22:31

Basically, I have 2 php script. 1 of the php scripts is to display and the other 1 is the watermark function.

I use this PHP to display the image with watermark:

2条回答
  •  醉话见心
    2020-12-21 22:58

    You can add and customize your output pictures with simple php codes like this that working with TopiLib: (You can add both image and text watermark, too)

    createFromPNG($_GET['image'], true);
    $img = new \TopiLib\TopiImage('watermark.png', 'transparent png');
    $img->startX = 100;  //your custom start X position
    $img->startY = 100;  //your custom start Y position
    $panel->addImage($img);
    $panel->render(); ?>
    

提交回复
热议问题