<table cellspacing="0" cellpadding="0"><tr><td class="t_f" id="postmessage_61778"> <div class="blockcode"> <div id="code_mvp"><ol> <li>$i = imagecreatefromjpeg("image.jpg");</li> <li> <li>for ($x=0;$x<imagesx($i);$x ) {<li> for ($y=0;$y<imagesy($i);$y ) {<li> $rgb = imagecolorat($i,$x,$y);<li> $r = ($rgb >> 16) & 0xFF;</li> <li> $g = ($rgb >> & 0xFF;</li> <li> $b = $rgb & 0xFF;</li> <li> <li> $rTotal = $r;</li> <li> $gTotal = $g;</li> <li> $bTotal = $b;</li> <li> $total ;</li> <li> }</li> <li>}</li> <li> <li>$rAverage = round($rTotal/$total);</li> <li>$gAverage = round($gTotal/$total);</li> <li>$bAverage = round($bTotal/$total);</li> </ol></div> <em onclick="copycode($('code_mvp'));">复制代码</em> </div> <br> </td></tr></table> <div class="ptg mbm mtn"> php</div> <div id="comment_61778" class="cm"> </div> <div id="post_rate_div_61778"></div> <br><br>