array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'en', ), 'this' => array ( 0 => 'function.imagecolordeallocate.php', 1 => 'imagecolordeallocate', ), 'up' => array ( 0 => 'ref.image.php', 1 => 'GD and Image Functions', ), 'prev' => array ( 0 => 'function.imagecolorclosesthwb.php', 1 => 'imagecolorclosesthwb', ), 'next' => array ( 0 => 'function.imagecolorexact.php', 1 => 'imagecolorexact', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/image/functions/imagecolordeallocate.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4, PHP 5, PHP 7, PHP 8)
imagecolordeallocate — De-allocate a color for an image
De-allocates a color previously allocated with imagecolorallocate() or imagecolorallocatealpha().
image
A GdImage object, returned by one of the image creation functions, such as imagecreatetruecolor().
color
The color identifier.
Version | Description |
---|---|
8.0.0 |
image expects a GdImage
instance now; previously, a valid gd resource was expected.
|
Example #1 Using imagecolordeallocate()
<?php
$white = imagecolorallocate($im, 255, 255, 255);
imagecolordeallocate($im, $white);
?>