<?php
bool imageistruecolor( GdImage $image )
where,
$image = The image identifier
?>
<?php
function istruecolor ($tstimg)
{
if(imageistruecolor($tstimg))
{
echo '<br>The image file
tested IS TRUECOLOR!<br><br>';
}
else
{
echo '<br>The image file
tested IS NOT TRUECOLOR!<br><br><br>';
}
}
$tst_img01a = "gif/GIF 010 02.gif";
$tst_img01b = "png/PNG 020 01 (gd22png).png";
echo $tst_img01a; ?><br>Existing Image
<br><br><img src="<?php echo $tst_img01a; ?>"
alt="<?php echo $tst_img01a; ?>"><br><br>
<?php
$id_01a = imagecreatefromgif($tst_img01a);
$nbcolors01a = imagecolorstotal($id_01a);
echo 'Number total of colors<br>
in this image: ' . $nbcolors01a . '<br>';
istruecolor($id_01a);
echo $tst_img01b; ?><br>Existing Image
<br><br><img src="<?php echo $tst_img01b; ?>"
alt="<?php echo $tst_img01b; ?>"><br><br>
<?php
$id_01b = imagecreatefrompng($tst_img01b);
$nbcolors01b = imagecolorstotal($id_01b);
echo 'Number total of colors<br>
in this image: ' . $nbcolors01b . '<br>';
istruecolor($id_01b);
?>