<?php
bool imagecolormatch ( GdImage $image1, GdImage $image2 )
where,
$image1 = The image resourse or object
for TRUECOLOR image
$image2 = The image resourse or object
for PALETTE image
?>
<?php
echo 'PHP VERSION: ' . PHP_VERSION . '<br><br>';
// $lang = 'pt';
$lang = 'en';
$img_tc = "jpeg/JPEG 027 01.jpg";
// TRUECOLOR IMAGE
$img_pl = "gif/GIF 023 01-a.gif";
// PALETTE IMAGE
$img_rs = "gif/GIF 023 01-b.gif";
// PALETTE IMAGE
echo basename($img_tc); ?><br><br>
<img src="<?php echo $img_tc; ?>"
alt="<?php echo $img_tc; ?>"
title="<?php echo $img_tc; ?>" width="400"><br><br>
<?php echo basename($img_pl); ?><br><br>
<img src="<?php echo $img_pl; ?>"
alt="<?php echo $img_pl; ?>"
title="<?php echo $img_pl; ?>" width="400"><br><br><br>
<?php
$id_imgtc = imagecreatefromjpeg($img_tc);
$id_imgpl = imagecreatefromgif($img_pl);
$is_clrmatch = imagecolormatch($id_imgtc, $id_imgpl);
if($is_clrmatch)
{
imagegif($id_imgpl, $img_rs);
echo basename($img_rs); ?><br><br>
<img src="<?php echo $img_rs; ?>"
alt="<?php echo $img_rs; ?>"
title="<?php echo $img_rs; ?>" width="400">
<?php
}
else
{
$pt = "A imagem não pôde ser convertida!<br>";
$en = "The image could not be converted!<br>";
echo '<br><br>' . $$lang;
}
?>