> 16) & 0xFF; $g[$x] = ($rgb[$x] >> 8) & 0xFF; $b[$x] = $rgb[$x] & 0xFF; } // calculate average RGB values $ravg = array_sum($r)/8; $gavg = array_sum($g)/8; $bavg = array_sum($b)/8; return imagecolorallocate($extra,rand($ravg-$smoothingoffset,$ravg+$smoothingoffset),rand($gavg-$smoothingoffset,$gavg+$smoothingoffset),rand($bavg-$smoothingoffset,$bavg+$smoothingoffset)); } ?>