witam
to jest obrazek wyjsciowy:
http://img90.imageshack.us/my.php?image=recruiteron6.jpgteraz jak znalesc x i y slowa ktore sie powtarza (IMG:
http://forum.php.pl/style_emoticons/default/questionmark.gif)
narazie malo mam:
<?
function getcolor( $img , $x , $y )
{
$rgb = imagecolorat($img , $x, $y);
$c['r'] = ($rgb >> 16) & 0xFF;
$c['g'] = ($rgb >> 8) & 0xFF;
$c['b'] = $rgb & 0xFF;
return $c;
}
function filtr( $img , $w , $h )
{
$im = imagecreate($w , $h );
$color = imagecolorallocate($im, 255,255,255);
$color2 = imagecolorallocate($im, 0,0,0 );
//var_dump( $height );
for ( $y = 0 ; $y <= $h ; $y ++ )
{
for ( $x = 0 ; $x <= $w ; $x ++ )
{
$c = getcolor( $img , $x , $y );
$c2 = getcolor( $img , $x , $y+1 );
$c3 = getcolor( $img , $x , $y+2 );
$c4 = getcolor( $img , $x-2 , $y );
$c5 = getcolor( $img , $x-1 , $y );
if ( $c['r'] > 70 && ($c2['r'] > 70 || $c3['r'] > 70) && ($c4['r'] > 70 || $c5['r'] > 70) )
{
//var_dump( $c );
imagesetpixel($im,$x,$y, $color2);
}
}
}
return $im;
}
$img = imagecreatefromjpeg( 'r.jpg' );
list
($width, $height, $type, $attr) = getimagesize('r.jpg');
$im = filtr( $img , $width , $height );
//$im = filtr2( $im , $width , $height );
header("Content-type: image/png"); imagepng($im );
imagedestroy($im);
?>
http://img132.imageshack.us/my.php?image=pomocya8.jpgktos wie jak to rozkminic (IMG:
http://forum.php.pl/style_emoticons/default/questionmark.gif)