位置: 编程技术 - 正文

PHP:imageconvolution()的用法_GD库图像处理函数

编辑:rootadmin
imageconvolution

推荐整理分享PHP:imageconvolution()的用法_GD库图像处理函数,希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:,内容如对您有帮助,希望把文章链接给更多的朋友!

(PHP 5 >= 5.1.0)

imageconvolution — 用系数 div 和 offset 申请一个 3x3 的卷积矩阵

说明 bool imageconvolution ( resource $image , array $matrix , float $div , float $offset )

Applies a convolution matrix on the image, using the given coefficient and offset.

参数

image

由图象创建函数(例如imagecreatetruecolor())返回的图象资源。

matrix

A 3x3 matrix: an array of three arrays of three floats.

div

The divisor of the result of the convolution, used for normalization.

offset PHP:imageconvolution()的用法_GD库图像处理函数

Color offset.

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE。

范例

Example #1 Embossing the PHP.net logo

<?php$image=imagecreatefromgif('

以上例程会输出:

Example #2 Gaussian blur

<?php$image=imagecreatetruecolor(,);//Writesthetextandapplyagaussianblurontheimageimagestring($image,5,,8,'GaussianBlurText',0xff);$gaussian=array(array(1.0,2.0,1.0),array(2.0,4.0,2.0),array(1.0,2.0,1.0));imageconvolution($image,$gaussian,,0);//Rewritesthetextforcomparisonimagestring($image,5,,,'GaussianBlurText',0xff);header('Content-Type:image/png');imagepng($image,null,9);?>

以上例程会输出:

注释

Note: 此函数仅在与 GD 库捆绑编译的 PHP 版本中可用。

参见

imagefilter() - 对图像使用过滤器

PHP:imagecolorstotal()的用法_GD库图像处理函数 imagecolorstotal(PHP4,PHP5)imagecolorstotal取得一幅图像的调色板中颜色的数目说明intimagecolorstotal(resource$image)本函数返回指定图像的调色板中的颜色数目。参见im

PHP:imagecolorsforindex()的用法_GD库图像处理函数 imagecolorsforindex(PHP4,PHP5)imagecolorsforindex取得某索引的颜色说明arrayimagecolorsforindex(resource$image,int$index)本函数返回一个具有red,green,blue和alpha的键名的关联

PHP:imagecolorset()的用法_GD库图像处理函数 imagecolorset(PHP4,PHP5)imagecolorset给指定调色板索引设定颜色说明voidimagecolorset(resource$image,int$index,int$red,int$green,int$blue)本函数将调色板中指定的索引设定为指

本文链接地址:https://www.jiuchutong.com/biancheng/288373.html 转载请保留说明!

上一篇:PHP:imagecopymergegray()的用法_GD库图像处理函数

下一篇:PHP:imagecolorstotal()的用法_GD库图像处理函数

免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

鄂ICP备2023003026号

网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

友情链接: 武汉网站建设 电脑维修 湖南楚通运网络