codice:
<?php
$img=imagecreatefromjpeg($_GET['url']);
imagetruecolortopalette($img,true,512);
echo imagecolorstotal($img);
?>
Works good