Easy Tutorial
❮ Func Filesystem Basename Php Ref Simplexml ❯

PHP imagecolordeallocate - Deallocate a Color for an Image

PHP Image Processing

imagecolordeallocate — Deallocate a color for an image.

Syntax

bool imagecolordeallocate ( resource $image , int $color )

The imagecolordeallocate() function deallocates a color previously allocated with imagecolorallocate() or imagecolorallocatealpha().

Example

<?php
header("Content-type: image/png");
$im = @imagecreate(100, 50)
    or die("Cannot Initialize new GD image stream");
$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);
?>

The above example outputs an image as follows:

Related Articles

PHP Image Processing

❮ Func Filesystem Basename Php Ref Simplexml ❯