English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
imagecolordeallocate — Cancel the allocation of image colors.
bool imagecolordeallocate ( resource $image , int $color )
The imagecolordeallocate() function cancels the previous allocation by imagecolorallocate() Or imagecolorallocatealpha() Allocated color.
<?php header("Content-type: image/png $im = @imagecreate(100, 50) or die("Cannot initialize a new GD image stream"); $background_color = imagecolorallocate($im, 255, 255, 255); $text_color = imagecolorallocate($im, 233, 14, 91); imagestring($im, 1, 5, 5, $text_color); imagecolordeallocate($im, $background_color); imagepng($im); imagedestroy($im); ?>
The image of the output result of the above example is as follows:
imagecolorallocate() Allocate colors for an image.
imagecolorallocatealpha() Allocate colors and opacity for an image.