
imagecolordeallocate — 取消图像颜色的分配。
语法
bool imagecolordeallocate ( resource $image , int $color )
imagecolordeallocate() 函数取消先前由 imagecolorallocate() 或 imagecolorallocatealpha() 分配的颜色。
示例
<?php
header("Content-type: image/png");
 $im = @imagecreate(100, 50)
     or die("不能初始化新的 GD 图像流");
 $background_color = imagecolorallocate($im, 255, 255, 255); 
 $text_color = imagecolorallocate($im, 233, 14, 91);
 imagestring($im, 1, 5, 5,  "A Simple Text String", $text_color);
 imagecolordeallocate($im, $background_color);
 imagepng($im);
 imagedestroy($im);
?>以上示例输出结果的图片如下:

相关文章
- imagecolorallocate() 为一幅图像分配颜色。 
- imagecolorallocatealpha() 为一幅图像分配颜色和透明度。 
PHP imagecolorexact() 函数取得指定颜色的索引值 PHP imagecolorexactalpha() 函数取得指定的颜色加透明度的索引值
