I have a problem..
There is some picture, like this:

and I want to add a new resolution, background, and better quality ( antialias) to this radar image. How can I get radar details from this image with a PHP script?
I have already this code, but the output isnt the best :S you can see it here:

<?
$im = imagecreatefromjpeg('a.jpg');
$f1 = imagecolorallocate($im, 39, 78, 231);
$a = imagecreatetruecolor ( 520, 370 );
$red = imagecolorallocate($a, 39,78,231);
for($x =130;$x<520;$x++)
{
for($y = 130; $y<370;$y++)
{
$rgb = imagecolorat($im, $x, $y);
$r = ($rgb >> 16) & 0xFF;
$g = ($rgb >> 8) & 0xFF;
$b = $rgb & 0xFF;
$red = imagecolorallocate($a, $r,$g,$b);
//echo $r.$ g.$b."|";
if( ($r < 100 && $r > 0) && ($g < 150 && $g > 0) && ($b < 255 && $b > 150))
imagesetpixel($a, $x, $y, $red);
if( ($r < 100 && $r > 0) && ($g < 255 && $g > 130) && ($b < 255 && $b > 0))
imagesetpixel($a, $x, $y, $red);
if( ($r < 200 && $r > 100) && ($g < 255 && $g > 180) && ($b < 80 && $b > 0))
imagesetpixel($a, $x, $y, $red);
if( ($r < 255 && $r > 0) && ($g < 255 && $g > 0) && ($b < 50 && $b > 0))
imagesetpixel($a, $x, $y, $red);
if( ($r < 255 && $r > 200) && ($g < 255 && $g > 70) && ($b < 70 && $b > 0))
imagesetpixel($a, $x, $y, $red);
if( ($r < 255 && $r > 200) && ($g < 100 && $g > 0) && ($b < 70 && $b > 0))
imagesetpixel($a, $x, $y, $red);
if( ($r < 120 && $r > 0) && ($g < 50 && $g > 0) && ($b < 50 && $b > 0))
imagesetpixel($a, $x, $y, $red);
}
}
//$rgb = imagecolorat($im, 550, 465);
//$r = ($rgb >> 16) & 0xFF;
//$g = ($rgb >> 8) & 0xFF;
//$b = $rgb & 0xFF;
//echo "$r $g $b";
header('Content-Type: image/png');
imagepng($a);
?>
replace kép.jpg with image. 1st try. I think I can adjust things to get closer.
2nd try: floor seems to be much better than round.
3rd try: added 2 filters to the code.