adlez wrote:Yes here is what the original image looks like.
And thanks for that tip I will mess with it.
*60,18
53,19
*161,19
*16,20
158,20
13,21
*134,21
11,22
127,22
10,23
9,24
123,24
8,25
*93,25
7,26
6,27
5,28
4,29
2,34
80,59
$coord = array();
for($y=0;$y<$h;$y++) {
for($x=0;$x<$w;$x++) {
$rgb = imagecolorat($im, $x, $y);
$data = imagecolorsforindex($im,$rgb);
if ($data['red'] == 0){
////////////////////////////
if (!isset($coord[0])){
$coord[0] = array($x,$y);
break;
}else{
$i = count($coord);
$coord[$i] = array($x,$y);
$white = imagecolorallocate($im,255,255,255);
for ($a=$x;$a<$x+40;$a++){
for ($b=$y;$b<$y+40;$b++){
imagesetpixel($im, $a,$b, $white);
}
}
}
/////////////////////////////
//once a black pixel is found, make all pixels with a 40x40 radius white//
}
}
}
TheMindRapist wrote:adlez wrote:Yes here is what the original image looks like.
And thanks for that tip I will mess with it.
You say the background is always the same, I assume that means it always has the same colors, and that those colors are unique. If so, setting to white all pixels with the background colors that do not touch a pixel with a non-background color, then setting to white all pixels that are not a background color then setting to black everything that is not white might give you something clearer to work with.
Edit: Actually, I can't tell if the outline has background colored pixels in it from looking at the image so this may not work.
Return to Interpreted Languages
Users browsing this forum: No registered users and 0 guests