无需言 做自己 业 ,精于勤 荒于嬉.
- GD 和图像处理 函数 imagecolorclosesthwb 取得与给定颜色最接近的色度的黑白色的索引
-
发表日期:2021-07-01 08:55:57 | 来源: | 分类:GD 和图像处理 函数
-
示例1
<?php $im = imagecreatefromgif('php.gif'); echo 'HWB: ' . imagecolorclosesthwb($im, 116, 115, 152); imagedestroy($im); ?>
- GD 和图像处理 函数 imagecolorat 取得某像素的颜色索引值
-
发表日期:2021-07-01 08:55:57 | 来源: | 分类:GD 和图像处理 函数
-
示例1
<?php $im = ImageCreateFromPng("rockym.png"); $rgb = ImageColorAt($im, 100, 100); $r = ($rgb >> 16) & 0xFF; $g = ($rgb >> 8) & 0xFF; $b = $rgb & 0xFF; ?>
- GD 和图像处理 函数 imagecolormatch 使一个图像中调色板版本的颜色与真彩色版本更能匹配
-
发表日期:2021-07-01 08:55:57 | 来源: | 分类:GD 和图像处理 函数
-
示例1
<?php // Setup the true color and palette images$im1 = imagecreatefrompng('./gdlogo.png'); $im2 = imagecreate(imagesx($im1), imagesy($im1)); // Add some colors to $im2$colors = Array(); $colors[] = imagecolorallocate($im2, 255, 36, 74); $colors[] = imagecolorallocate($im2, 40, 0, 240); $colors[] = imagecolorallocate($im2, 82, 100, 255); $colors[] = imagecolorallocate($im2, 84, 63, 44); // Match these colors with the true color imageimagecolormatch($im1, $im2); // Free from memoryimagedestroy($im1); imagedestroy($im2); ?>
- GD 和图像处理 函数 imagecolordeallocate 取消图像颜色的分配
-
发表日期:2021-07-01 08:55:57 | 来源: | 分类:GD 和图像处理 函数
-
示例1
<?php $white = imagecolorallocate($im, 255, 255, 255); imagecolordeallocate($im, $white); ?>
- GD 和图像处理 函数 imagecolorexactalpha 取得指定的颜色加透明度的索引值
-
发表日期:2021-07-01 08:55:57 | 来源: | 分类:GD 和图像处理 函数
-
示例1
<?php // Setup an image$im = imagecreatefrompng('./gdlogo.png'); $colors = Array(); $colors[] = imagecolorexactalpha($im, 255, 0, 0, 0); $colors[] = imagecolorexactalpha($im, 0, 0, 0, 127); $colors[] = imagecolorexactalpha($im, 255, 255, 255, 55); $colors[] = imagecolorexactalpha($im, 100, 255, 52, 20); print_r($colors); // Free from memoryimagedestroy($im); ?>
- GD 和图像处理 函数 imagecolorset 给指定调色板索引设定颜色
-
发表日期:2021-07-01 08:55:57 | 来源: | 分类:GD 和图像处理 函数
-
imagecolorset
(PHP 4, PHP 5, PHP 7, PHP 8)
imagecolorset — 给指定调色板索引设定颜色
说明
imagecolorset(
resource$image
,
int$index
,
int$red
,
int$green
,
int$blue
): void本函数将调色板中指定的索引设定为指定的颜色。对于在调色板图像中创建类似区域填充(flood-fill)的效果很有用,免去了真的去填充的开销。
参见 imagecolorat()。
- GD 和图像处理 函数 imagecolorsforindex 取得某索引的颜色
-
发表日期:2021-07-01 08:55:57 | 来源: | 分类:GD 和图像处理 函数
-
示例1
<?php // 打开一幅图像$im = imagecreatefrompng('nexen.png'); // 取得一点的颜色$start_x = 40; $start_y = 50; $color_index = imagecolorat($im, $start_x, $start_y); // 使其可读$color_tran = imagecolorsforindex($im, $color_index); // 显示该颜色的值echo '<pre>'; print_r($color_tran); echo '</pre>'; ?>
- GD 和图像处理 函数 imagecolorresolve 取得指定颜色的索引值或有可能得到的最接近的替代值
-
发表日期:2021-07-01 08:55:57 | 来源: | 分类:GD 和图像处理 函数
-
imagecolorresolve
(PHP 4, PHP 5, PHP 7, PHP 8)
imagecolorresolve — 取得指定颜色的索引值或有可能得到的最接近的替代值
说明
imagecolorresolve(
resource$image
,
int$red
,
int$green
,
int$blue
): int本函数可以保证对所请求的颜色返回一个颜色索引,要么是确切值要么是所能得到最接近的替代值。
如果从文件创建了图像,只有图像中使用了的颜色会被辨析。仅出现在调色板中的颜色不会被辨析。
- GD 和图像处理 函数 imagecolorstotal 取得一幅图像的调色板中颜色的数目
-
发表日期:2021-07-01 08:55:57 | 来源: | 分类:GD 和图像处理 函数
-
imagecolorstotal
(PHP 4, PHP 5, PHP 7, PHP 8)
imagecolorstotal — 取得一幅图像的调色板中颜色的数目
说明
imagecolorstotal(resource$image
): int本函数返回指定图像的调色板中的颜色数目。
- GD 和图像处理 函数 imagecolortransparent 将某个颜色定义为透明色
-
发表日期:2021-07-01 08:55:57 | 来源: | 分类:GD 和图像处理 函数
-
imagecolortransparent
(PHP 4, PHP 5, PHP 7, PHP 8)
imagecolortransparent — 将某个颜色定义为透明色
说明
imagecolortransparent(resource$image
, int$color
= ?): intimagecolortransparent() 将
image
图像中的透明色设定为color
。image
是 imagecreatetruecolor() 返回的图像标识符,color
是 imagecolorallocate() 返回的颜色标识符。注意:
透明色是图像的一种属性,透明度不是颜色的属性。一旦设定了某个颜色为透明色,图像中之前画为该色的任何区域都成为透明的。
返回新透明色的标识符,如果省略
color
则返回当前透明色的标识符。注意:
透明度仅能通过 imagecopymerge() 和真彩色图像拷贝,不能用 imagecopy() 或调色板图像。
- GD 和图像处理 函数 imagecopy 拷贝图像的一部分
-
发表日期:2021-07-01 08:55:57 | 来源: | 分类:GD 和图像处理 函数
-
imagecopy
(PHP 4, PHP 5, PHP 7, PHP 8)
imagecopy — 拷贝图像的一部分
说明
imagecopy(
resource$dst_im
,
resource$src_im
,
int$dst_x
,
int$dst_y
,
int$src_x
,
int$src_y
,
int$src_w
,
int$src_h
): bool将
src_im
图像中坐标从src_x
,src_y
开始,宽度为src_w
,高度为src_h
的一部分拷贝到dst_im
图像中坐标为dst_x
和dst_y
的位置上。
- GD 和图像处理 函数 imagecopymerge 拷贝并合并图像的一部分
-
发表日期:2021-07-01 08:55:57 | 来源: | 分类:GD 和图像处理 函数
-
imagecopymerge
(PHP 4 >= 4.0.1, PHP 5, PHP 7, PHP 8)
imagecopymerge — 拷贝并合并图像的一部分
说明
imagecopymerge(
resource$dst_im
,
resource$src_im
,
int$dst_x
,
int$dst_y
,
int$src_x
,
int$src_y
,
int$src_w
,
int$src_h
,
int$pct
): bool将
src_im
图像中坐标从src_x
,src_y
开始,宽度为src_w
,高度为src_h
的一部分拷贝到dst_im
图像中坐标为dst_x
和dst_y
的位置上。两图像将根据pct
来决定合并程度,其值范围从 0 到 100。当pct
= 0 时,实际上什么也没做,当为 100 时对于调色板图像本函数和 imagecopy() 完全一样,它对真彩色图像实现了 alpha 透明。注意:
本函数是 PHP 4.0.6 新加的。
- GD 和图像处理 函数 imagecopymergegray 用灰度拷贝并合并图像的一部分
-
发表日期:2021-07-01 08:55:57 | 来源: | 分类:GD 和图像处理 函数
-
imagecopymergegray
(PHP 4 >= 4.0.6, PHP 5, PHP 7, PHP 8)
imagecopymergegray — 用灰度拷贝并合并图像的一部分
说明
imagecopymergegray(
resource$dst_im
,
resource$src_im
,
int$dst_x
,
int$dst_y
,
int$src_x
,
int$src_y
,
int$src_w
,
int$src_h
,
int$pct
): bool将
src_im
图像中坐标从src_x
,src_y
开始,宽度为src_w
,高度为src_h
的一部分拷贝到dst_im
图像中坐标为dst_x
和dst_y
的位置上。两图像将根据pct
来决定合并程度,其值范围从 0 到 100。当pct
= 0 时,实际上什么也没做,当为 100 时本函数和 imagecopy() 完全一样。本函数和 imagecopymerge() 完全一样只除了合并时通过在拷贝操作前将目标像素转换为灰度级来保留了原色度。
注意:
本函数添加于 PHP 4.0.6。
- GD 和图像处理 函数 imageconvolution 用系数 div 和 offset 申请一个 3x3 的卷积矩阵
-
发表日期:2021-07-01 08:55:57 | 来源: | 分类:GD 和图像处理 函数
-
示例1
<?php $image = imagecreatefromgif('http://www.php.net/images/php.gif'); $emboss = array(array(2, 0, 0), array(0, -1, 0), array(0, 0, -1)); imageconvolution($image, $emboss, 1, 127); header('Content-Type: image/png'); imagepng($image, null, 9); ?>
示例2
<?php $image = imagecreatetruecolor(180,40); // Writes the text and apply a gaussian blur on the imageimagestring($image, 5, 10, 8, 'Gaussian Blur Text', 0x00ff00); $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, 16, 0); // Rewrites the text for comparisonimagestring($image, 5, 10, 18, 'Gaussian Blur Text', 0x00ff00); header('Content-Type: image/png'); imagepng($image, null, 9); ?>
- GD 和图像处理 函数 imagecolorresolvealpha 取得指定颜色 + alpha 的索引值或有可能得到的最接近的替代值
-
发表日期:2021-07-01 08:55:57 | 来源: | 分类:GD 和图像处理 函数
-
示例1
<?php // Load an image$im = imagecreatefromgif('phplogo.gif'); // Get closest colors from the image$colors = array(); $colors[] = imagecolorresolvealpha($im, 255, 255, 255, 0); $colors[] = imagecolorresolvealpha($im, 0, 0, 200, 127); // Outputprint_r($colors); imagedestroy($im); ?>
- GD 和图像处理 函数 imagecolorexact 取得指定颜色的索引值
-
发表日期:2021-07-01 08:55:57 | 来源: | 分类:GD 和图像处理 函数
-
imagecolorexact
(PHP 4, PHP 5, PHP 7, PHP 8)
imagecolorexact — 取得指定颜色的索引值
说明
imagecolorexact(
resource$image
,
int$red
,
int$green
,
int$blue
): int返回图像调色板中指定颜色的索引值。
如果颜色不在图像的调色板中,返回 -1。
如果从文件创建了图像,只有图像中使用了的颜色会被辨析。仅出现在调色板中的颜色不会被辨析。
- GD 和图像处理 函数 getimagesizefromstring 从字符串中获取图像尺寸信息
-
发表日期:2021-07-01 08:55:56 | 来源: | 分类:GD 和图像处理 函数
-
示例1
<?php $img = '/path/to/test.png'; // 以文件方式打开$size_info1 = getimagesize($img); // 以字符串格式打开$data = file_get_contents($img); $size_info2 = getimagesizefromstring($data); ?>
- GD 和图像处理 函数 imageaffine 返回经过仿射变换后的图像,剪切区域可选
-
发表日期:2021-07-01 08:55:56 | 来源: | 分类:GD 和图像处理 函数
-
imageaffine
(PHP 5 >= 5.5.0, PHP 7, PHP 8)
imageaffine — 返回经过仿射变换后的图像,剪切区域可选
说明
imageaffine(resource$image
, array$affine
, array$clip
= ?): resource警告本函数还未编写文档,仅有参数列表。
参数
-
image
-
由图象创建函数(例如imagecreatetruecolor())返回的图象资源。
-
affine
-
数组,其中键为 0 至 5 的数字。
-
clip
-
数组,其中键为 "x","y","width" 和 "height"。
返回值
成功则返回仿射变换后的图像, 或者在失败时返回
false
. -
- GD 和图像处理 函数 image_type_to_mime_type 取得 getimagesize,exif_read_data,exif_thumbnail,exif_imagetype 所返回的图像类型的 MIME 类型
-
发表日期:2021-07-01 08:55:56 | 来源: | 分类:GD 和图像处理 函数
-
示例1
<?php header("Content-type: " . image_type_to_mime_type(IMAGETYPE_PNG)); ?>
- GD 和图像处理 函数 image2wbmp 以 WBMP 格式将图像输出到浏览器或文件
-
发表日期:2021-07-01 08:55:56 | 来源: | 分类:GD 和图像处理 函数
-
示例1
<?php $file = 'php.jpg'; $image = imagecreatefrompng($file); header('Content-type: ' . image_type_to_mime(IMAGETYPE_WBMP)); image2wbmp($file); // output the stream directly?>
- 前端开发(1)
- 数据库(0)
- PHP(0)
- PHP杂项(34)
- PHP基础-李炎恢系列课程(20)
- 中文函数手册(0)
- 错误处理 函数(13)
- OPcache 函数(6)
- PHP 选项/信息 函数(54)
- Zip 函数(10)
- Hash 函数(15)
- OpenSSL 函数(63)
- Date/Time 函数(51)
- 目录函数(9)
- Fileinfo 函数(6)
- iconv 函数(11)
- 文件系统函数(81)
- 多字节字符串 函数(57)
- GD 和图像处理 函数(114)
- 可交换图像信息(5)
- Math 函数(50)
- 程序执行函数(11)
- PCNTL 函数(23)
- JSON 函数(4)
- SPL 函数(15)
- URL 函数(10)
- cURL 函数(32)
- 网络 函数(33)
- FTP 函数(36)
- Session 函数(23)
- PCRE 函数(11)
- PCRE 正则语法(19)
- 数组 函数(81)
- 类/对象 函数(18)
- 函数处理 函数(13)
- 变量处理 函数(37)
- SimpleXML 函数(3)
- 杂项 函数(31)
- 字符串 函数(101)
- JAVA(0)
- Android(0)
- Linux(0)
- 其他(0)