Ⅰ 怎麼給php 網站視頻添加水印
通過php調用ffmpeg命令加水印!
Ⅱ php如何實現水印平鋪
代碼如下:
imagick代碼:
<?php
$image = new imagick('logo.jpg');
$im = new imagick();
$im->newimage( 140, 80, new imagickpixel( "none" ) );
$draw = new imagickdraw();
$draw->setfillcolor(new imagickpixel( "grey" ));
$draw->setgravity(imagick::gravity_northwest);
$draw->annotation(10,10 ,'right');
$draw->setgravity(imagick::gravity_southeast);
$draw->annotation(5,15 ,'right');
$im->drawimage( $draw);
$image = $image->textureimage($im);
$image->compositeimage($image,imagick::composite_,0,0);
header( "content-type: image/{$image->getimageformat()}" );
$image->writeimage('wmark_text_tiled.jpg');
$image->clear();
$image->destroy();
?>
Ⅲ thinkphp 文字水印 怎麼調透明度
可以支持水印圖片的透明度(0~100,默認值是80),例如:
$image=newThinkImage();
//在圖片左上角添加水印(水印文件位於./logo.png)水印圖片的透明度為50並保存為water.jpg
$image->open('./1.jpg')->water('./logo.png',ThinkImage::IMAGE_WATER_NORTHWEST,50)->save("water.jpg");