[英]ImageMagick and adding a visual watermark
I am currently trying to work with ImageMagick and teaching myself as I go. 我目前正在尝试与ImageMagick一起工作,并在自学过程中自学。
I have managed to get images to upload and then be converted size wise, and append some text to them, but I ideally need to append a logo to them. 我设法使图像上载,然后按大小进行转换,并向其中添加一些文本,但理想情况下,我需要在其上添加徽标。
I have been reading through the documentation via the ImageMagick website but feel I am making stupid mistakes now. 我一直在通过ImageMagick网站阅读文档,但现在我犯了一些愚蠢的错误。
This is the code I have for the ImageMagick command, can anyone shed some light on what I actually need to do to fix this? 这是我对ImageMagick命令的代码,任何人都可以对我实际需要解决的问题有所了解吗?
$cmd = 'mogrify -composite -disolve 25% -gravity southwest watermark_new.png '.$thefile.' '.$thefile.'';
Thanks for all the help guys. 感谢所有帮助人员。
THIS FIXED THE PROBLEM: 这解决了问题:
$cmd = 'mogrify -gravity southwest -geometry +30+30 -draw "image Over 0,0 '.$width.','.$height.' \''.$watermark.'\'" '.$thefile;
I dont think you need the mogrify part - the command you're actually looking to use is composite
- have you tried: 我认为您不需要mogrify部分-您实际上要使用的命令是composite
-您是否尝试过:
$cmd = 'composite -disolve 25% -gravity southwest watermark_new.png '.$thefile.' '.$thefile.'';
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.