note 38426 deleted from function.imagecolorstotal by didou

From: Date: Sat, 20 Dec 2003 17:36:26 +0000
Subject: note 38426 deleted from function.imagecolorstotal by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-62273@lists.php.net to get a copy of this message
Note Submitter: jonathan.gotti@free.fr ---- Voici une fonction pour compter le nombre de couleurs réellements utilisé dans une image gd; /** * get really used colors * @author jonathan.gotti@free.fr * @date 2003-12-20 * @param ressource image $img * @return int */ function imagecolorcount($img){ $width = imagesx($img); $height= imagesy($img); for($x=0;$x<$width;$x++){ #chaque ligne de l'image for($y=0;$y<$height;$y++){ #chaque colonnes $colors[imagecolorat($img,$x,$y)]=TRUE; } } return count($colors); }

« previous php.notes (#62273) next »