Php 向图像添加水印

Php 向图像添加水印,php,laravel,intervention,Php,Laravel,Intervention,我正在使用图像/干预软件包在图像上写入文本(作为水印)。现在,我希望文本有一个背景颜色和一个独特的形状。我想要这样的东西 这就是我目前正在做的事情 $code=7025; 如果($request->file){ $i=1; foreach($request->file as$photo){ $i++; $file=$photo; $img=Image::make($file); $height=$img->height(); $width=$img->width(); $aHeight=10*

我正在使用图像/干预软件包在图像上写入文本(作为水印)。现在,我希望文本有一个背景颜色和一个独特的形状。我想要这样的东西

这就是我目前正在做的事情

$code=7025;
如果($request->file){
$i=1;
foreach($request->file as$photo){
$i++;
$file=$photo;
$img=Image::make($file);
$height=$img->height();
$width=$img->width();
$aHeight=10*$height/100;
$aWidth=90*$width/100;
$img->text($code、$aWidth、$aHeight、function($font){
$font->file(公共路径('font1.ttf');
$font->size(45);
$font->color('d90f0f');
$font->align('right');
$font->valign('top');
});
$img_url=$code+$i;
$img->save(公共路径('images/'.$img\u url..jpg');
}
}
请问我如何完成这个背景颜色和形状