>8)&0xff); $noise=rand(-255,255); $b=((($p+$noise)>>16)&0xff); $noise=rand(-255,255); //and fade it to the chosen color. $r=($r*(1-$TRANS)+$pr*$TRANS); if (abs($pr-$r)<$SAMELIMIT) $r+=$SAMELIMIT; $g=($g*(1-$TRANS)+$pg*$TRANS); if (abs($pg-$g)<$SAMELIMIT) $g+=$SAMELIMIT; $b=($b*(1-$TRANS)+$pb*$TRANS); if (abs($pb-$b)<$SAMELIMIT) $b+=$SAMELIMIT; if ($g>255) $r-=255; if ($g>255) $g-=255; if ($b>255) $b-=255; //And put back to the captcha image. imagesetpixel($captcha,$x+$ox,$y+$offs,$r+($g<<8)+($b<<16)); } } } //And spit out the image. header("Content-type: image/png"); imagepng($captcha); ?>