本文实例讲述了PHP的图像处理。分享给大家供大家参考,具体如下:
1、添加文字水印
//1、打开图片资源
$src="....imagecolorallocate($image,255,255,255);
imagettftext($image,10,0,0,$info[1]-5,$color,$font,$content);//图片上写文字...$type);//输出到本地路径
//销毁图片内存资源
imagedestroy($image);
2、压缩图像
//打开图像
$src="....$type;
$image=$create($src);
//压缩
$tinyImg=imagecreatetruecolor(100,100); //新建压缩后的图像资源
//将原图映射到压缩后的图像资源上...,原图x位置,原图y位置,水印x起点,水印y起点,水印x终点,水印y终点,不透明度)
header("content-type:".