位置: 编程技术 - 正文

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

编辑:rootadmin
imagetruecolortopalette

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

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

(PHP 4 >= 4.0.6, PHP 5)

imagetruecolortopalette — 将真彩色图像转换为调色板图像

说明 bool imagetruecolortopalette ( resource $image , bool $dither , int $ncolors )

imagetruecolortopalette() 将一幅真彩色图像转换为调色板图像。本函数的代码原本是从独立的 JPEG 小组库代码中提取出来的,非常出色。此代码被修改以在结果调色板中保留尽可能多的 alpha 通道信息以及尽可能多的颜色。但并没有达到期望的效果。通常最好生成真彩色图像输出,这样可以保证得到最高的输出质量。

参数

image

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

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

指明图像是否被抖动(dithered),如果为 TRUE 则图像将被抖动使图像中的斑点更多但是颜色更接近。

ncolors

设定调色板中被保留的颜色的最大数目。

返回值

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

范例

Example #1 Converting a true color image to a palette-based image

<?php//Createanewtruecolorimage$im=imagecreatetruecolor(,);//Converttopalette-basedwithnoditheringandcolorsimagetruecolortopalette($im,false,);//Savetheimageimagepng($im,'./paletteimage.png');imagedestroy($im);?>

注释

Note: 此函数需要 GD 2.0.1 或更高版本(推荐 2.0. 及更高版本)。

PHP:imagesx()的用法_GD库图像处理函数 imagesx(PHP4,PHP5)imagesx取得图像宽度说明intimagesx(resource$image)imagesx()返回image所代表的图像的宽度。Example#1使用imagesx()?php//createa*image$img=imagecreatetruecolor(

PHP:imagesettile()的用法_GD库图像处理函数 imagesettile(PHP4=4.0.6,PHP5)imagesettile设定用于填充的贴图说明boolimagesettile(resource$image,resource$tile)imagesettile()设定所有区域填充函数(例如imagefill()和imagefilledpo

PHP:imagesetstyle()的用法_GD库图像处理函数 imagesetstyle(PHP4=4.0.6,PHP5)imagesetstyle设定画线的风格说明boolimagesetstyle(resource$image,array$style)imagesetstyle()设定所有画线的函数(例如imageline()和imagepolygon())在

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

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

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

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

鄂ICP备2023003026号

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

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