image
image copied to clipboard
How to resize the watermark or the inserted image?
How can we resize the inserted image
One way to do this is to:
- create a new image with a transparent background with the dimensions of the original watermark image
- add your watermark to this image (see note below)
- adjust the size and opacity of this combined watermark image as you want
- insert the image over the base image
You can do all of this using two separate Intervention images, but I find it is hard to adjust opacity using the Intervention->opacity() method, which appears to be quite inefficient; it seems to be easier to vary the opacity of the watermark by initially creating the watermark image as an empty transparent GdImage object and then combine this with the watermark source image using something like imagecopymerge_alpha (see in user added comments), then adding the watermark to the base image using the Intervention->insert() method.
HTH