note 98663 added to function.imagefilter

From: Date: Tue, 29 Jun 2010 17:49:50 +0000
Subject: note 98663 added to function.imagefilter
Groups: php.notes 
Request: Send a blank email to php-notes+get-170558@lists.php.net to get a copy of this message
http://www.onbest.com.br/ oferece: função Hue com suporte a '.gif' e outros suportados pela GD. function hue($img,$r,$g,$b){ $w=imagesx($img); $h=imagesy($img); if(!imageistruecolor($this->img)){ $image=imagecreatetruecolor($w,$h); $color=imagecolorallocatealpha($image,255,255,255,127); imagecolortransparent($image,$color); imagefill($image,0,0,$color); imagecopyresampled($image,$img,0,0,0,0,$w,$h,$w,$h); $img=$image; } $rgb=$r+$g+$b; $col=array($r/$rgb,$b/$rgb,$g/$rgb); for($x=0;$x<$w;$x++){ for($y=0;$y<$h;$y++){ $rgb=imagecolorat($img,$x,$y); $r=($rgb>>16) & 0xFF; $g=($rgb>>8) & 0xFF; $b=$rgb & 0xFF; $newR=$r*$col[0]+$g*$col[1]+$b*$col[2]; $newG=$r*$col[2]+$g*$col[0]+$b*$col[1]; $newB=$r*$col[1]+$g*$col[2]+$b*$col[0]; imagesetpixel($img,$x,$y,imagecolorallocate($img,$newR,$newG,$newB)); } } ---- Server IP: 187.16.23.128 Probable Submitter: 201.1.75.225 ---- Manual Page -- http://www.php.net/manual/en/function.imagefilter.php Edit -- https://master.php.net/note/edit/98663 Del: integrated -- https://master.php.net/note/delete/98663/integrated Del: useless -- https://master.php.net/note/delete/98663/useless Del: bad code -- https://master.php.net/note/delete/98663/bad+code Del: spam -- https://master.php.net/note/delete/98663/spam Del: non-english -- https://master.php.net/note/delete/98663/non-english Del: in docs -- https://master.php.net/note/delete/98663/in+docs Del: other reasons-- https://master.php.net/note/delete/98663 Reject -- https://master.php.net/note/reject/98663 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#170558) next »