4

I used the imagemagic to place the watermark image. I used the following code to display the watermark in center.

shell_exec("composite -gravity center logo.png images/test.png images/test.png");

Now I want to display the watermark in bottom right corner.

For this i tried the code:

composite -geometry -10-10

But i couldn't display this in bottom right.

Rizier123
  • 58,877
  • 16
  • 101
  • 156
designersvsoft
  • 1,861
  • 9
  • 39
  • 66

2 Answers2

3

Use:

shell_exec("composite -gravity SouthEast logo.png images/test.png images/test.png");
Migue
  • 1,401
  • 2
  • 15
  • 19
-1

Use for Bottom Right Corner:

imagecopyresampled( $output, $source, 0, 0, 0, 0,$width, $height,$width,$height);

Use this code for Center of the Image:

$watermark_pos_x = (imagesx($image)/2) - (imagesx($watermark)/2) - 15; $watermark_pos_y = (imagesy($image)/2) - (imagesy($watermark)/2) - 10;

// merge the source image and the watermark imagecopy($image, $watermark, $watermark_pos_x, $watermark_pos_y, 0, 0,imagesx($watermark), imagesy($watermark));

Flexforce PRO
  • 49
  • 1
  • 1
  • 8