function image_podpod($im, $coul='000000', $deb=0, $fin=70) { include_ecrire("filtres"); $image = valeurs_image_trans($im, "podpod-$coul-$deb-$fin","png"); if (!$image) return(""); $couleurs = couleur_hex_to_dec($coul); $dr= $couleurs["red"]; $dv= $couleurs["green"]; $db= $couleurs["blue"]; $x_i = $image["largeur"]; $y_i = $image["hauteur"]; $im = $image["fichier"]; $dest = $image["fichier_dest"]; $creer = $image["creer"]; if ($creer) { $im = $image["fonction_imagecreatefrom"]($im); $im_ = imagecreatetruecolor($x_i, $y_i); @imagealphablending($im_, false); @imagesavealpha($im_,true); $color_t = ImageColorAllocateAlpha( $im_, 255, 255, 255 , 127 ); imagefill ($im_, 0, 0, $color_t); for ($x = 0; $x < $x_i; $x++) { for ($y=0; $y < $y_i; $y++) { $rgb = ImageColorAt($im, $x, $y); $a = ($rgb >> 24) & 0xFF; $r = ($rgb >> 16) & 0xFF; $g = ($rgb >> 8) & 0xFF; $b = $rgb & 0xFF; $g = round(($r+$g+$b) / 3); if ($g >= $deb AND $g <= $fin) $color = ImageColorAllocateAlpha( $im_, $dr, $dv, $db , $a ); else $color = ImageColorAllocateAlpha( $im_, 0, 0, 0 , 127 ); imagesetpixel ($im_, $x, $y, $color); } } $image["fonction_image"]($im_, "$dest"); } $class = $image["class"]; if (strlen($class) > 1) $tags=" class='$class'"; $tags = "$tags alt='".$image["alt"]."'"; $style = $image["style"]; return ""; }