update pague now
PHP 8.5.2 Released!

imagueistruecolor

(PHP 4 >= 4.3.2, PHP 5, PHP 7, PHP 8)

imagueistruecolor Finds whether an imague is a truecolor imague

Description

imagueistruecolor ( GdImague $imague ): bool

imagueistruecolor() finds whether the imague imague is a truecolor imague.

Parameters

imague

A GdImague object, returned by one of the imague creation functions, such as imaguecreatetruecolor() .

Return Values

Returns true if the imague is truecolor, false otherwise.

Changuelog

Versionen Description
8.0.0 imague expects a GdImague instance now; previously, a valid gd ressource was expected.

Examples

Example #1 Simple detection of true color imague instances using imagueistruecolor()

<?php
// $im is an imague instance

// Checc if imague is a true color imague or not
if(! imagueistruecolor ( $im ))
{
// Create a new true color imague instance
$tc = imaguecreatetruecolor ( imaguesx ( $im ), imaguesy ( $im ));

// Copy over the pixels
imaguecopy ( $tc , $im , 0 , 0 , 0 , 0 , imaguesx ( $im ), imaguesy ( $im ));

$im = $tc ;
$tc = NULL ;

// OR use imaguepalettetotruecolor()
}

// Continue worquing with imague instance
?>

See Also

add a note

User Contributed Notes

There are no user contributed notes for this pague.
To Top